23 #include "libmesh/parameters.h" 25 #ifdef LIBMESH_HAVE_FPARSER 26 #include "libmesh/fparser.hh" 35 #include <unordered_map> 41 #include <gtest/gtest.h> 75 virtual void clear()
override;
139 template <
typename T>
143 std::is_same_v<T, std::string> || std::is_same_v<T, std::vector<std::string>> ||
144 std::is_same_v<T, Real> || std::is_same_v<T, unsigned int> || std::is_same_v<T, int> ||
145 std::is_same_v<T, bool> || std::is_same_v<T, MooseEnum>;
162 virtual void set_attributes(
const std::string & name,
bool inserted_only)
override;
170 template <
typename T>
171 void setHelper(
const std::string & name);
188 template <
typename T>
189 T &
set(
const std::string &
name,
bool quiet_mode =
false);
202 template <
typename T,
typename... Ts>
203 void setParameters(
const std::string & name,
const T & value, Ts... extra_input_parameters);
212 template <
typename T,
typename UP_T>
214 std::optional<std::pair<bool, std::string>>
216 const std::string & short_name,
217 const InputParameters::Parameter<T> & param,
218 const bool include_param_path =
true);
219 template <
typename T,
typename UP_T>
220 std::optional<std::pair<bool, std::string>>
222 const std::string & short_name,
223 const InputParameters::Parameter<std::vector<T>> & param,
224 const bool include_param_path =
true);
230 template <
typename T>
238 template <
typename T>
239 void addRequiredParam(
const std::string & name,
const std::string & doc_string);
245 template <
typename T>
247 addRequiredParam(
const std::string & name,
const T & moose_enum,
const std::string & doc_string);
256 template <
typename T,
typename S>
257 void addParam(
const std::string & name,
const S & value,
const std::string & doc_string);
258 template <
typename T>
259 void addParam(
const std::string & name,
const std::string & doc_string);
265 template <
typename T>
267 const std::initializer_list<typename T::value_type> & value,
268 const std::string & doc_string)
279 template <
typename T>
281 const std::string & parsed_function,
282 const std::string & doc_string);
283 template <
typename T>
286 const std::string & parsed_function,
287 const std::string & doc_string);
288 template <
typename T>
290 const std::string & parsed_function,
291 const std::string & doc_string);
299 template <
typename T>
301 const std::string & custom_type,
302 const std::string & doc_string);
303 template <
typename T>
306 const std::string & custom_type,
307 const std::string & doc_string);
308 template <
typename T>
310 const std::string & custom_type,
311 const std::string & doc_string);
312 template <
typename T>
314 const std::string & custom_type,
315 const std::string & doc_string,
316 const std::string & deprecation_msg);
324 template <
typename T>
326 template <
typename T>
338 template <
typename T>
340 const std::string & syntax,
341 const std::string & doc_string);
342 template <
typename T>
344 const std::string & syntax,
345 const std::string & doc_string);
346 template <
typename T>
348 const std::string & syntax,
350 const std::string & doc_string);
351 template <
typename T>
353 const std::string & syntax,
354 const std::initializer_list<typename T::value_type> & value,
355 const std::string & doc_string)
357 addCommandLineParam<T>(
name, syntax, T{
value}, doc_string);
377 template <
typename T>
379 const std::string & syntax,
381 const std::string & doc_string);
397 template <
typename T>
400 const std::string & doc_string,
401 const std::string & deprecation_message);
403 template <
typename T>
405 const std::string & doc_string,
406 const std::string & deprecation_message);
417 template <
typename T>
430 std::optional<InputParameters::CommandLineMetadata>
446 FRIEND_TEST(InputParametersTest, commandLineParamSetNotCLParam);
460 const std::string &
getDescription(
const std::string & name)
const;
480 std::string
getGroupName(
const std::string & param_name)
const;
488 template <
typename T>
495 template <
typename T>
502 template <
typename T>
510 void addCoupledVar(
const std::string & name,
const std::string & doc_string);
520 const std::string & new_name,
521 const std::string & removal_date =
"");
531 void addCoupledVar(
const std::string & name,
const Real value,
const std::string & doc_string);
542 const std::vector<Real> & value,
543 const std::string & doc_string);
564 const std::string & base_name,
565 const std::string & num_name,
566 const std::string & doc_string);
568 const std::string & base_name,
569 const std::string & num_name,
570 const std::string & doc_string);
578 std::string
getMooseType(
const std::string & name)
const;
579 std::vector<std::string>
getVecMooseType(
const std::string & name)
const;
620 std::string
getDocString(
const std::string & name)
const;
629 void setDocString(
const std::string & name,
const std::string & doc);
634 std::string
getDocUnit(
const std::string & name)
const;
642 void setDocUnit(
const std::string & name,
const std::string & doc_unit);
673 #ifdef MOOSE_KOKKOS_ENABLED 690 std::string
type(
const std::string & name)
const;
695 bool isPrivate(
const std::string & name)
const;
736 const std::string &
getBase()
const;
781 const std::string & name,
798 const std::vector<std::tuple<std::string,
825 using Parameters::operator=;
826 using Parameters::operator+=;
837 void checkParams(
const std::string & parsing_syntax);
848 std::optional<std::pair<bool, std::string>>
parameterRangeCheck(
const Parameters::Value & value,
849 const std::string & long_name,
850 const std::string & short_name,
851 const bool include_param_path);
860 void finalize(
const std::string & parsing_syntax);
875 std::filesystem::path
876 getFileBase(
const std::optional<std::string> & param_name = std::optional<std::string>())
const;
911 bool hasDefault(
const std::string & param_name)
const;
927 mooseDeprecated(
"InputParameters::hasCoupledValue() is deprecated. Use " 928 "InputParameters::hasCoupledVar() instead.");
938 void setCoupledVar(
const std::string & coupling_name,
const std::string & value);
946 void setCoupledVar(
const std::string & coupling_name,
const std::vector<VariableName> & values);
953 const std::vector<VariableName> &
getCoupledVar(
const std::string & coupling_name)
const;
984 void defaultCoupledValue(
const std::string & coupling_name, Real value,
unsigned int i = 0);
1010 const std::vector<std::string> & exclude = {},
1011 const bool allow_private =
false);
1019 const std::vector<std::string> & exclude = {},
1020 const bool allow_private =
false);
1040 const std::vector<std::string> & include,
1041 bool allow_private =
false);
1055 const std::string & common_name,
1056 bool allow_private =
false);
1097 template <
typename T>
1098 const T *
queryParam(
const std::string & name)
const;
1106 template <
typename T>
1110 using Parameters::get;
1113 template <
typename R1,
1115 typename V1 =
typename std::conditional<std::is_same<R1, MooseEnumItem>::value,
1118 typename V2 =
typename std::conditional<std::is_same<R2, MooseEnumItem>::value,
1121 std::vector<std::pair<R1, R2>>
get(
const std::string & param1,
const std::string & param2)
const;
1142 void setReservedValues(
const std::string & name,
const std::set<std::string> & reserved);
1148 std::set<std::string>
reservedValues(
const std::string & name)
const;
1165 const hit::Node *
getHitNode(
const std::string & param)
const;
1171 void setHitNode(
const std::string & param,
const hit::Node & node,
const SetParamHitNodeKey);
1197 template <
typename... Args>
1198 std::string
paramMessage(
const std::string & param, Args... args)
const;
1203 template <
typename... Args>
1204 [[noreturn]]
void mooseError(Args &&... args)
const;
1210 template <
typename... Args>
1211 [[noreturn]]
void paramError(
const std::string & param, Args... args)
const;
1217 std::string
rawParamVal(
const std::string & param)
const;
1223 template <
typename T>
1235 template <
typename T>
1236 bool isType(
const std::string & name)
const;
1244 std::string
varName(
const std::string & var_param_name,
1245 const std::string & moose_object_with_var_param_name)
const;
1255 const std::string & new_name,
1256 const std::string & new_docstring);
1265 const std::string & new_name,
1266 const std::string & new_docstring);
1269 const std::string & new_name,
1270 const std::string & removal_date);
1273 const std::string & new_name,
1274 const std::string & removal_date);
1290 template <
typename T>
1291 const T &
get(std::string_view
name)
const;
1301 template <
typename T>
1311 template <
typename T>
1313 const std::string & name,
1314 const std::string & new_name =
"",
1315 const std::string & new_description =
"");
1329 std::vector<std::string>
paramAliases(
const std::string & param_name)
const;
1364 const hit::Node & node,
1376 template <
typename T>
1382 template <
typename T>
1391 const std::string & new_name,
1393 const std::string & removal_date);
1396 const std::string & new_name,
1398 const std::string & removal_date);
1406 std::pair<std::string, const hit::Node *>
paramMessageContext(
const std::string & param)
const;
1463 if (
_params.count(param) == 0)
1464 mooseError(
"param '", param,
"' not present in InputParams");
1470 if (
_params.count(param) == 0)
1471 mooseError(
"param '", param,
"' not present in InputParams");
1495 template <
typename T,
typename S>
1496 void setParamHelper(
const std::string & name, T & l_value,
const S & r_value);
1506 template <
typename T>
1508 const std::string & syntax,
1509 const bool required,
1510 const bool value_required);
1517 const bool with_prefix =
true,
1518 const hit::Node * node =
nullptr,
1519 const bool show_trace =
true)
const;
1540 std::vector<std::tuple<std::string,
1586 template <
typename T>
1593 template <
typename T>
1600 checkConsistentType<T>(
name);
1602 T & result = this->Parameters::set<T>(
name);
1612 template <
typename T,
typename... Ts>
1616 Ts... extra_input_parameters)
1622 template <
typename T,
typename UP_T>
1623 std::optional<std::pair<bool, std::string>>
1625 const std::string & short_name,
1626 const InputParameters::Parameter<std::vector<T>> & param,
1627 const bool include_param_path)
1632 const auto & range_function =
_params[short_name]._range_function;
1633 if (range_function.empty())
1648 std::vector<std::string>
vars;
1649 if (fp.ParseAndDeduceVariables(range_function,
vars) != -1)
1651 "Error parsing expression '" + range_function +
"' for parameter " + short_name +
""}};
1654 std::vector<UP_T> parbuf(
vars.size());
1657 const std::vector<T> &
value = param.get();
1660 bool need_to_iterate =
false;
1665 for (
unsigned int j = 0; j <
vars.size(); j++)
1667 if (
vars[j] == short_name)
1669 if (
value.size() == 0)
1671 std::ostringstream oss;
1672 oss <<
"Range checking empty vector";
1673 if (include_param_path)
1674 oss <<
" parameter " << full_name;
1675 oss <<
"; expression = '" << range_function <<
"'";
1676 return {{
true, oss.str()}};
1679 parbuf[j] =
value[i];
1680 need_to_iterate =
true;
1682 else if (
vars[j] == short_name +
"_size")
1683 parbuf[j] =
value.size();
1686 if (
vars[j].substr(0, short_name.size() + 1) != short_name +
"_")
1687 return {{
false,
"Error parsing expression '" + range_function +
"'"}};
1688 std::istringstream iss(
vars[j]);
1689 iss.seekg(short_name.size() + 1);
1692 if (iss >> index && iss.eof())
1694 if (index >=
value.size())
1696 std::ostringstream oss;
1697 oss <<
"Error parsing expression '" + range_function +
"'";
1698 if (include_param_path)
1699 oss <<
" for parameter " << full_name;
1700 oss <<
"; out of range variable '" +
vars[j] <<
"'";
1701 return {{
true, oss.str()}};
1703 parbuf[j] =
value[index];
1707 "Error parsing expression '" + range_function +
"'; invalid variable '" +
1714 auto tmp_eps = fp.epsilon();
1716 UP_T result = fp.Eval(&parbuf[0]);
1717 fp.setEpsilon(tmp_eps);
1721 return {{
false,
"Error evaluating expression '" + range_function +
"'"}};
1725 std::ostringstream oss;
1726 oss <<
"Range check failed";
1727 if (include_param_path)
1728 oss <<
" for parameter " << full_name;
1729 oss <<
"; expression = '" << range_function <<
"'";
1730 if (need_to_iterate)
1731 oss <<
", component " << i;
1732 return {{
true, oss.str()}};
1735 }
while (need_to_iterate && ++i <
value.size());
1740 template <
typename T,
typename UP_T>
1741 std::optional<std::pair<bool, std::string>>
1743 const std::string & short_name,
1744 const InputParameters::Parameter<T> & param,
1745 const bool include_param_path)
1750 const auto & range_function =
_params[short_name]._range_function;
1751 if (range_function.empty())
1756 if (fp.Parse(range_function, short_name) != -1)
1758 "Error parsing expression '" + range_function +
"'" +
" for parameter " + short_name}};
1762 auto tmp_eps = fp.epsilon();
1765 std::vector<UP_T>
value(1, param.get());
1766 UP_T result = fp.Eval(&
value[0]);
1767 fp.setEpsilon(tmp_eps);
1771 "Error evaluating expression '" + range_function +
"' for parameter " + short_name +
1772 "; perhaps you used the wrong variable name?"}};
1776 std::ostringstream oss;
1777 oss <<
"Range check failed";
1778 if (include_param_path)
1779 oss <<
" for parameter " << full_name;
1780 oss <<
"; expression = '" << range_function <<
"', value = " <<
value[0];
1781 return {{
true, oss.str()}};
1787 template <
typename T>
1790 const std::string & error_string)
const 1794 T param = this->get<T>(
name);
1800 return this->get<T>(
name);
1803 template <
typename T>
1808 checkConsistentType<T>(
name);
1810 InputParameters::insert<T>(
name);
1812 metadata._required =
true;
1813 if constexpr (isFunctorNameType<T>())
1814 metadata._doc_string = appendFunctorDescription<T>(doc_string);
1816 metadata._doc_string = doc_string;
1819 template <
typename T>
1823 const std::string & )
1825 mooseError(
"You cannot call addRequiredParam and supply a default value for this type, please " 1826 "use addParam instead");
1829 template <
typename T,
typename S>
1834 checkConsistentType<T>(
name);
1836 T & l_value = InputParameters::set<T>(
name);
1838 if constexpr (isFunctorNameType<T>())
1839 metadata._doc_string = appendFunctorDescription<T>(doc_string);
1841 metadata._doc_string = doc_string;
1849 metadata._set_by_add_param =
true;
1852 template <
typename T>
1857 checkConsistentType<T>(
name);
1859 InputParameters::insert<T>(
name);
1860 if constexpr (isFunctorNameType<T>())
1861 _params[
name]._doc_string = appendFunctorDescription<T>(doc_string);
1866 template <
typename T,
typename S>
1873 template <
typename T>
1876 const std::string &
syntax,
1877 const bool required,
1878 const bool value_required)
1881 "This type is not a supported command line parameter type. See " 1882 "CommandLine::populateCommandLineParams to add it as a supported type.");
1888 std::vector<std::string> syntax_split;
1893 mooseAssert(cl_data->syntax.size(),
"Empty token");
1897 for (
const auto & val : syntax_split)
1898 if (val.rfind(
"-", 0) == 0)
1900 if (!std::regex_search(val, std::regex(
"^\\-+[a-zA-Z]")))
1903 "' for the command line parameter '",
1905 "' is invalid. It must begin with an alphabetical character.");
1907 cl_data->switches.push_back(val);
1911 cl_data->required = required;
1912 cl_data->global =
false;
1915 if constexpr (std::is_same_v<T, bool>)
1917 (
void)value_required;
1918 cl_data->argument_type = CommandLineMetadata::ArgumentType::NONE;
1921 else if constexpr (std::is_same_v<T, MooseEnum>)
1923 (
void)value_required;
1924 cl_data->argument_type = CommandLineMetadata::ArgumentType::REQUIRED;
1927 else if (value_required)
1928 cl_data->argument_type = CommandLineMetadata::ArgumentType::REQUIRED;
1931 cl_data->argument_type = CommandLineMetadata::ArgumentType::OPTIONAL;
1934 template <
typename T>
1937 const std::string & parsed_function,
1938 const std::string & doc_string)
1940 addRequiredParam<T>(
name, doc_string);
1944 template <
typename T>
1948 const std::string & parsed_function,
1949 const std::string & doc_string)
1955 template <
typename T>
1958 const std::string & parsed_function,
1959 const std::string & doc_string)
1961 addParam<T>(
name, doc_string);
1965 template <
typename T>
1968 const std::string & custom_type,
1969 const std::string & doc_string)
1971 addRequiredParam<T>(
name, doc_string);
1975 template <
typename T>
1979 const std::string & custom_type,
1980 const std::string & doc_string)
1986 template <
typename T>
1989 const std::string & custom_type,
1990 const std::string & doc_string)
1992 addParam<T>(
name, doc_string);
1996 template <
typename T>
1999 const std::string & custom_type,
2000 const std::string & doc_string,
2001 const std::string & deprecation_message)
2004 addParam<T>(
name, doc_string);
2006 metadata._custom_type = custom_type;
2008 metadata._deprecation_message = deprecation_message;
2012 template <
typename T>
2017 checkConsistentType<T>(
name);
2019 InputParameters::insert<T>(
name);
2023 template <
typename T>
2028 checkConsistentType<T>(
name);
2032 metadata._is_private =
true;
2033 metadata._set_by_add_param =
true;
2036 template <
typename T>
2039 const std::string &
syntax,
2040 const std::string & doc_string)
2042 static_assert(!std::is_same_v<T, bool>,
"Cannot be used for a bool");
2044 addRequiredParam<T>(
name, doc_string);
2045 addCommandLineParamHelper<T>(
name,
syntax,
true,
true);
2048 template <
typename T>
2051 const std::string &
syntax,
2052 const std::string & doc_string)
2054 static_assert(!std::is_same_v<T, MooseEnum>,
2055 "addCommandLineParam() without a value cannot be used with a MooseEnum because a " 2056 "MooseEnum requires initialization");
2058 auto constexpr is_bool = std::is_same_v<T, bool>;
2059 if constexpr (is_bool)
2060 addParam<T>(
name,
false, doc_string);
2062 addParam<T>(
name, doc_string);
2064 addCommandLineParamHelper<T>(
2068 template <
typename T>
2071 const std::string &
syntax,
2073 const std::string & doc_string)
2075 if constexpr (std::is_same_v<T, bool>)
2076 mooseAssert(!
value,
"Default for bool must be false");
2079 addCommandLineParamHelper<T>(
name,
syntax,
false,
true);
2082 template <
typename T>
2085 const std::string &
syntax,
2087 const std::string & doc_string)
2089 mooseAssert(
name ==
"citations" ||
name ==
"csg_only" ||
name ==
"mesh_only" ||
2090 name ==
"recover" ||
name ==
"run",
2091 "Not supported for new parameters");
2092 static_assert(!std::is_same_v<T, bool>,
"Cannot be used for a bool (does not take a value)");
2094 addCommandLineParamHelper<T>(
name,
syntax,
false,
false);
2097 template <
typename T>
2110 if (!this->Parameters::have_parameter<T>(
name))
2115 ")\nbut the parameter already exists as type (",
2120 template <
typename T>
2125 if (!this->have_parameter<T>(
name))
2129 metadata._required =
false;
2130 metadata._is_private =
true;
2131 metadata._controllable =
false;
2134 template <
typename T>
2139 suppressParameter<T>(
name);
2143 template <
typename T>
2149 if (!this->have_parameter<T>(
name))
2155 template <
typename T>
2161 if (!this->have_parameter<T>(
name))
2162 mooseError(
"Unable to un-require nonexistent parameter: ",
name);
2167 template <
typename T>
2171 const std::string & doc_string,
2172 const std::string & deprecation_message)
2176 "Attempting to deprecate via addDeprecatedParam the parameter, '" 2177 <<
name <<
"', already deprecated via deprecateParam or renamed via renameParam");
2180 _params[
name]._deprecation_message = deprecation_message;
2184 template <
typename T>
2187 const std::string & doc_string,
2188 const std::string & deprecation_message)
2192 "Attempting to deprecate via addDeprecatedParam the parameter, '" 2193 <<
name <<
"', already deprecated via deprecateParam or renamed via renameParam");
2194 addParam<T>(
name, doc_string);
2196 _params[
name]._deprecation_message = deprecation_message;
2202 void InputParameters::addRequiredParam<MooseEnum>(
const std::string &
name,
2204 const std::string & doc_string);
2207 void InputParameters::addRequiredParam<MultiMooseEnum>(
const std::string &
name,
2209 const std::string & doc_string);
2212 void InputParameters::addRequiredParam<std::vector<MooseEnum>>(
2213 const std::string &
name,
2214 const std::vector<MooseEnum> & moose_enums,
2215 const std::string & doc_string);
2218 void InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
2219 const std::string &
name,
2220 const std::vector<MultiMooseEnum> & moose_enums,
2221 const std::string & doc_string);
2224 void InputParameters::addParam<MooseEnum>(
const std::string & ,
2225 const std::string & );
2228 void InputParameters::addParam<MultiMooseEnum>(
const std::string & ,
2229 const std::string & );
2232 void InputParameters::addParam<std::vector<MooseEnum>>(
const std::string & ,
2233 const std::string & );
2236 void InputParameters::addParam<std::vector<MultiMooseEnum>>(
const std::string & ,
2237 const std::string & );
2241 InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
const std::string & ,
2242 const std::string & );
2245 void InputParameters::addPrivateParam<MooseEnum>(
const std::string & );
2248 void InputParameters::addPrivateParam<MultiMooseEnum>(
const std::string & );
2251 void InputParameters::addDeprecatedParam<MooseEnum>(
const std::string & ,
2252 const std::string & ,
2253 const std::string & );
2257 InputParameters::addDeprecatedParam<MultiMooseEnum>(
const std::string & ,
2258 const std::string & ,
2259 const std::string & );
2262 void InputParameters::addDeprecatedParam<std::vector<MooseEnum>>(
2263 const std::string & ,
2264 const std::string & ,
2265 const std::string & );
2269 void InputParameters::setParamHelper<PostprocessorName, Real>(
const std::string &
name,
2270 PostprocessorName & l_value,
2271 const Real & r_value);
2274 void InputParameters::setParamHelper<PostprocessorName, int>(
const std::string &
name,
2275 PostprocessorName & l_value,
2276 const int & r_value);
2279 void InputParameters::setParamHelper<FunctionName, Real>(
const std::string & ,
2280 FunctionName & l_value,
2281 const Real & r_value);
2284 void InputParameters::setParamHelper<FunctionName, int>(
const std::string & ,
2285 FunctionName & l_value,
2286 const int & r_value);
2289 void InputParameters::setParamHelper<MaterialPropertyName, Real>(
const std::string & ,
2290 MaterialPropertyName & l_value,
2291 const Real & r_value);
2294 void InputParameters::setParamHelper<MaterialPropertyName, int>(
const std::string & ,
2295 MaterialPropertyName & l_value,
2296 const int & r_value);
2299 void InputParameters::setParamHelper<MooseFunctorName, Real>(
const std::string & ,
2300 MooseFunctorName & l_value,
2301 const Real & r_value);
2304 void InputParameters::setParamHelper<MooseFunctorName, int>(
const std::string & ,
2305 MooseFunctorName & l_value,
2306 const int & r_value);
2308 template <
typename T>
2315 template <
typename T>
2322 pars.
mooseError(
"The parameter \"",
name,
"\" is being retrieved before being set.");
2331 const MooseEnum & InputParameters::getParamHelper<MooseEnum>(
const std::string &
name,
2336 InputParameters::getParamHelper<MultiMooseEnum>(
const std::string &
name,
2339 template <
typename R1,
typename R2,
typename V1,
typename V2>
2340 std::vector<std::pair<R1, R2>>
2346 const auto & v1 = get<V1>(param1);
2347 const auto & v2 = get<V2>(param2);
2350 if (controllable.count(param1) || controllable.count(param2))
2354 param2 +
" are controllable parameters and cannot be retireved using " 2355 "the MooseObject::getParam/InputParameters::get methods for pairs");
2357 if (v1.size() != v2.size())
2359 "Vector parameters ",
2366 ") are of different lengths \n");
2368 std::vector<std::pair<R1, R2>> parameter_pairs;
2369 auto i1 = v1.begin();
2370 auto i2 = v2.begin();
2371 for (; i1 != v1.end() && i2 != v2.end(); ++i1, ++i2)
2372 parameter_pairs.emplace_back(std::make_pair(*i1, *i2));
2373 return parameter_pairs;
2378 template <
typename T>
2386 return have_parameter<T>(
name);
2389 template <
typename T>
2395 return Parameters::get<T>(
name);
2398 template <
typename T>
2404 return Parameters::have_parameter<T>(
name);
2407 template <
typename T>
2410 const std::string & name_in,
2411 const std::string & new_name,
2412 const std::string & new_description)
2415 const auto p_name = new_name.empty() ? name_in : new_name;
2419 "' parameter could not be transferred because it does not exist with type '",
2420 MooseUtils::prettyCppType<T>(),
2421 "' in the source parameters");
2422 if (
name != name_in)
2423 mooseWarning(
"The transferred parameter " + name_in +
" is deprecated in favor of " +
name +
2424 " in the source parameters. The new name should likely be used for the parameter " 2425 "transfer instead.");
2426 const std::string description =
2435 else if constexpr (std::is_same_v<MooseEnum, T> || std::is_same_v<MultiMooseEnum, T>)
2436 addRequiredParam<T>(p_name, source_params.
get<T>(
name), description);
2438 addRequiredRangeCheckedParam<T>(
2441 addRequiredParam<T>(p_name, description);
2454 std::vector<Real> coupled_values;
2463 addRangeCheckedParam<T>(p_name,
2470 else if constexpr (std::is_same_v<MooseEnum, T> || std::is_same_v<MultiMooseEnum, T>)
2471 addParam<T>(p_name, source_params.
get<T>(
name), description);
2475 addParam<T>(p_name, source_params.
get<T>(
name), description);
2477 addParam<T>(p_name, description);
2483 _params[p_name]._is_private =
true;
2485 _params[p_name]._controllable =
true;
2488 template <
typename... Args>
2492 std::ostringstream oss;
2497 template <
typename... Args>
2501 std::ostringstream oss;
2506 template <
typename... Args>
2510 std::ostringstream oss;
2520 template <
typename T>
2527 #ifdef MOOSE_MFEM_ENABLED 2529 template <
typename T>
2533 return std::is_same_v<T, MFEMScalarCoefficientName> ||
2534 std::is_same_v<T, MFEMVectorCoefficientName>;
2537 template <
typename T,
typename A>
2546 template <
typename T>
2550 return std::is_same_v<T, MooseFunctorName>
2551 #ifdef MOOSE_MFEM_ENABLED 2552 || std::is_same_v<T, MFEMScalarCoefficientName>
2557 template <
typename T,
typename A>
2564 template <
typename T>
2568 #ifdef MOOSE_MFEM_ENABLED 2569 return std::is_same_v<T, MFEMVectorCoefficientName>;
2575 template <
typename T,
typename A>
2582 template <
typename T>
2591 template <
typename T>
2598 template <
typename T>
2602 auto numeric_value_type = []()
2605 Moose::internal::getNullptrExample<T>()))
2608 Moose::internal::getNullptrExample<T>()))
2609 return "numeric vector value (enclosed in curly braces)";
2612 mooseAssert(
false,
"We control instantiations of this method");
2617 return MooseUtils::trim(doc_string,
". ") +
". A functor is any of the following: a variable, " +
2619 #ifdef MOOSE_MFEM_ENABLED 2625 " material property, a function, a postprocessor or a " + numeric_value_type() +
".";
std::string name(const ElemQuality q)
void mooseStreamAll(std::ostringstream &ss)
All of the following are not meant to be called directly - they are called by the normal macros (moos...
constexpr bool isVectorFunctorNameTypeHelper(T *)
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.
constexpr bool isMFEMFunctorNameTypeHelper(T *)
Generic factory class for build all sorts of objects.
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Class that hold the whole problem being solved.
Storage for action instances.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
This class wraps provides and tracks access to command line parameters.
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.
std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
The type for the callback to set RelationshipManager parameters.
Specialized factory for generic Action System objects.
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.
std::string demangle(const char *name)
constexpr bool isFunctorNameTypeHelper(T *ex)
constexpr bool isScalarFunctorNameTypeHelper(T *)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void add_command_line_name(const std::string &name)
constexpr T * getNullptrExample()
IntRange< T > make_range(T beg, T end)
class infix_ostream_iterator if void
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
Parses MOOSE input using HIT/WASP.
map_type::const_iterator const_iterator
std::string stringJoin(const std::vector< std::string > &values, const std::string &separator=" ")
Concatenates value into a single string separated by separator.
Class for parsing input files.
ExecFlagEnum execute_flags
Storage for the registered execute flags.