22 #include "libmesh/parameters.h" 24 #ifdef LIBMESH_HAVE_FPARSER 25 #include "libmesh/fparser.hh" 34 #include <unordered_map> 40 #include <gtest/gtest.h> 74 virtual void clear()
override;
138 template <
typename T>
142 std::is_same_v<T, std::string> || std::is_same_v<T, std::vector<std::string>> ||
143 std::is_same_v<T, Real> || std::is_same_v<T, unsigned int> || std::is_same_v<T, int> ||
144 std::is_same_v<T, bool> || std::is_same_v<T, MooseEnum>;
161 virtual void set_attributes(
const std::string & name,
bool inserted_only)
override;
169 template <
typename T>
170 void setHelper(
const std::string & name);
187 template <
typename T>
188 T &
set(
const std::string &
name,
bool quiet_mode =
false);
201 template <
typename T,
typename... Ts>
202 void setParameters(
const std::string & name,
const T & value, Ts... extra_input_parameters);
211 template <
typename T,
typename UP_T>
213 std::optional<std::pair<bool, std::string>>
215 const std::string & short_name,
216 const InputParameters::Parameter<T> & param,
217 const bool include_param_path =
true);
218 template <
typename T,
typename UP_T>
219 std::optional<std::pair<bool, std::string>>
221 const std::string & short_name,
222 const InputParameters::Parameter<std::vector<T>> & param,
223 const bool include_param_path =
true);
229 template <
typename T>
237 template <
typename T>
238 void addRequiredParam(
const std::string & name,
const std::string & doc_string);
244 template <
typename T>
246 addRequiredParam(
const std::string & name,
const T & moose_enum,
const std::string & doc_string);
255 template <
typename T,
typename S>
256 void addParam(
const std::string & name,
const S & value,
const std::string & doc_string);
257 template <
typename T>
258 void addParam(
const std::string & name,
const std::string & doc_string);
264 template <
typename T>
266 const std::initializer_list<typename T::value_type> & value,
267 const std::string & doc_string)
278 template <
typename T>
280 const std::string & parsed_function,
281 const std::string & doc_string);
282 template <
typename T>
285 const std::string & parsed_function,
286 const std::string & doc_string);
287 template <
typename T>
289 const std::string & parsed_function,
290 const std::string & doc_string);
298 template <
typename T>
300 const std::string & custom_type,
301 const std::string & doc_string);
302 template <
typename T>
305 const std::string & custom_type,
306 const std::string & doc_string);
307 template <
typename T>
309 const std::string & custom_type,
310 const std::string & doc_string);
311 template <
typename T>
313 const std::string & custom_type,
314 const std::string & doc_string,
315 const std::string & deprecation_msg);
323 template <
typename T>
325 template <
typename T>
337 template <
typename T>
339 const std::string & syntax,
340 const std::string & doc_string);
341 template <
typename T>
343 const std::string & syntax,
344 const std::string & doc_string);
345 template <
typename T>
347 const std::string & syntax,
349 const std::string & doc_string);
350 template <
typename T>
352 const std::string & syntax,
353 const std::initializer_list<typename T::value_type> & value,
354 const std::string & doc_string)
356 addCommandLineParam<T>(
name, syntax, T{
value}, doc_string);
376 template <
typename T>
378 const std::string & syntax,
380 const std::string & doc_string);
396 template <
typename T>
399 const std::string & doc_string,
400 const std::string & deprecation_message);
402 template <
typename T>
404 const std::string & doc_string,
405 const std::string & deprecation_message);
416 template <
typename T>
429 std::optional<InputParameters::CommandLineMetadata>
445 FRIEND_TEST(InputParametersTest, commandLineParamSetNotCLParam);
459 const std::string &
getDescription(
const std::string & name)
const;
479 std::string
getGroupName(
const std::string & param_name)
const;
487 template <
typename T>
494 template <
typename T>
501 template <
typename T>
509 void addCoupledVar(
const std::string & name,
const std::string & doc_string);
519 const std::string & new_name,
520 const std::string & removal_date =
"");
530 void addCoupledVar(
const std::string & name,
const Real value,
const std::string & doc_string);
541 const std::vector<Real> & value,
542 const std::string & doc_string);
563 const std::string & base_name,
564 const std::string & num_name,
565 const std::string & doc_string);
567 const std::string & base_name,
568 const std::string & num_name,
569 const std::string & doc_string);
577 std::string
getMooseType(
const std::string & name)
const;
578 std::vector<std::string>
getVecMooseType(
const std::string & name)
const;
619 std::string
getDocString(
const std::string & name)
const;
628 void setDocString(
const std::string & name,
const std::string & doc);
633 std::string
getDocUnit(
const std::string & name)
const;
641 void setDocUnit(
const std::string & name,
const std::string & doc_unit);
681 std::string
type(
const std::string & name)
const;
686 bool isPrivate(
const std::string & name)
const;
727 const std::string &
getBase()
const;
772 const std::string & name,
789 const std::vector<std::tuple<std::string,
816 using Parameters::operator=;
817 using Parameters::operator+=;
828 void checkParams(
const std::string & parsing_syntax);
839 std::optional<std::pair<bool, std::string>>
parameterRangeCheck(
const Parameters::Value & value,
840 const std::string & long_name,
841 const std::string & short_name,
842 const bool include_param_path);
851 void finalize(
const std::string & parsing_syntax);
866 std::filesystem::path
867 getFileBase(
const std::optional<std::string> & param_name = std::optional<std::string>())
const;
902 bool hasDefault(
const std::string & param_name)
const;
940 void defaultCoupledValue(
const std::string & coupling_name, Real value,
unsigned int i = 0);
966 const std::vector<std::string> & exclude = {},
967 const bool allow_private =
false);
987 const std::vector<std::string> & include,
988 bool allow_private =
false);
1003 const std::string & common_name,
1004 bool allow_private =
false,
1005 bool override_default =
false);
1044 template <
typename T>
1051 template <
typename R1,
1053 typename V1 =
typename std::conditional<std::is_same<R1, MooseEnumItem>::value,
1056 typename V2 =
typename std::conditional<std::is_same<R2, MooseEnumItem>::value,
1059 std::vector<std::pair<R1, R2>>
get(
const std::string & param1,
const std::string & param2)
const;
1080 void setReservedValues(
const std::string & name,
const std::set<std::string> & reserved);
1086 std::set<std::string>
reservedValues(
const std::string & name)
const;
1103 const hit::Node *
getHitNode(
const std::string & param)
const;
1109 void setHitNode(
const std::string & param,
const hit::Node & node,
const SetParamHitNodeKey);
1135 template <
typename... Args>
1136 std::string
paramMessage(
const std::string & param, Args... args)
const;
1141 template <
typename... Args>
1142 [[noreturn]]
void mooseError(Args &&... args)
const;
1148 template <
typename... Args>
1149 [[noreturn]]
void paramError(
const std::string & param, Args... args)
const;
1155 std::string
rawParamVal(
const std::string & param)
const;
1161 template <
typename T>
1173 template <
typename T>
1174 bool isType(
const std::string & name)
const;
1182 std::string
varName(
const std::string & var_param_name,
1183 const std::string & moose_object_with_var_param_name)
const;
1193 const std::string & new_name,
1194 const std::string & new_docstring);
1203 const std::string & new_name,
1204 const std::string & new_docstring);
1207 const std::string & new_name,
1208 const std::string & removal_date);
1211 const std::string & new_name,
1212 const std::string & removal_date);
1228 template <
typename T>
1229 const T &
get(std::string_view
name)
const;
1239 template <
typename T>
1249 template <
typename T>
1251 const std::string & name,
1252 const std::string & new_name =
"",
1253 const std::string & new_description =
"");
1267 std::vector<std::string>
paramAliases(
const std::string & param_name)
const;
1302 const hit::Node & node,
1314 template <
typename T>
1320 template <
typename T>
1329 const std::string & new_name,
1331 const std::string & removal_date);
1334 const std::string & new_name,
1336 const std::string & removal_date);
1344 std::pair<std::string, const hit::Node *>
paramMessageContext(
const std::string & param)
const;
1401 if (
_params.count(param) == 0)
1402 mooseError(
"param '", param,
"' not present in InputParams");
1408 if (
_params.count(param) == 0)
1409 mooseError(
"param '", param,
"' not present in InputParams");
1433 template <
typename T,
typename S>
1434 void setParamHelper(
const std::string & name, T & l_value,
const S & r_value);
1444 template <
typename T>
1446 const std::string & syntax,
1447 const bool required,
1448 const bool value_required);
1455 const bool with_prefix =
true,
1456 const hit::Node * node =
nullptr)
const;
1477 std::vector<std::tuple<std::string,
1523 template <
typename T>
1530 template <
typename T>
1537 checkConsistentType<T>(
name);
1539 T & result = this->Parameters::set<T>(
name);
1549 template <
typename T,
typename... Ts>
1553 Ts... extra_input_parameters)
1559 template <
typename T,
typename UP_T>
1560 std::optional<std::pair<bool, std::string>>
1562 const std::string & short_name,
1563 const InputParameters::Parameter<std::vector<T>> & param,
1564 const bool include_param_path)
1569 const auto & range_function =
_params[short_name]._range_function;
1570 if (range_function.empty())
1585 std::vector<std::string>
vars;
1586 if (fp.ParseAndDeduceVariables(range_function,
vars) != -1)
1588 "Error parsing expression '" + range_function +
"' for parameter " + short_name +
""}};
1591 std::vector<UP_T> parbuf(
vars.size());
1594 const std::vector<T> &
value = param.get();
1597 bool need_to_iterate =
false;
1602 for (
unsigned int j = 0; j <
vars.size(); j++)
1604 if (
vars[j] == short_name)
1606 if (
value.size() == 0)
1608 std::ostringstream oss;
1609 oss <<
"Range checking empty vector";
1610 if (include_param_path)
1611 oss <<
" parameter " << full_name;
1612 oss <<
"; expression = '" << range_function <<
"'";
1613 return {{
true, oss.str()}};
1616 parbuf[j] =
value[i];
1617 need_to_iterate =
true;
1619 else if (
vars[j] == short_name +
"_size")
1620 parbuf[j] =
value.size();
1623 if (
vars[j].substr(0, short_name.size() + 1) != short_name +
"_")
1624 return {{
false,
"Error parsing expression '" + range_function +
"'"}};
1625 std::istringstream iss(
vars[j]);
1626 iss.seekg(short_name.size() + 1);
1629 if (iss >> index && iss.eof())
1631 if (index >=
value.size())
1633 std::ostringstream oss;
1634 oss <<
"Error parsing expression '" + range_function +
"'";
1635 if (include_param_path)
1636 oss <<
" for parameter " << full_name;
1637 oss <<
"; out of range variable '" +
vars[j] <<
"'";
1638 return {{
true, oss.str()}};
1640 parbuf[j] =
value[index];
1644 "Error parsing expression '" + range_function +
"'; invalid variable '" +
1651 auto tmp_eps = fp.epsilon();
1653 UP_T result = fp.Eval(&parbuf[0]);
1654 fp.setEpsilon(tmp_eps);
1658 return {{
false,
"Error evaluating expression '" + range_function +
"'"}};
1662 std::ostringstream oss;
1663 oss <<
"Range check failed";
1664 if (include_param_path)
1665 oss <<
" for parameter " << full_name;
1666 oss <<
"; expression = '" << range_function <<
"'";
1667 if (need_to_iterate)
1668 oss <<
", component " << i;
1669 return {{
true, oss.str()}};
1672 }
while (need_to_iterate && ++i <
value.size());
1677 template <
typename T,
typename UP_T>
1678 std::optional<std::pair<bool, std::string>>
1680 const std::string & short_name,
1681 const InputParameters::Parameter<T> & param,
1682 const bool include_param_path)
1687 const auto & range_function =
_params[short_name]._range_function;
1688 if (range_function.empty())
1693 if (fp.Parse(range_function, short_name) != -1)
1695 "Error parsing expression '" + range_function +
"'" +
" for parameter " + short_name}};
1699 auto tmp_eps = fp.epsilon();
1702 std::vector<UP_T>
value(1, param.get());
1703 UP_T result = fp.Eval(&
value[0]);
1704 fp.setEpsilon(tmp_eps);
1708 "Error evaluating expression '" + range_function +
"' for parameter " + short_name +
1709 "; perhaps you used the wrong variable name?"}};
1713 std::ostringstream oss;
1714 oss <<
"Range check failed";
1715 if (include_param_path)
1716 oss <<
" for parameter " << full_name;
1717 oss <<
"; expression = '" << range_function <<
"', value = " <<
value[0];
1718 return {{
true, oss.str()}};
1724 template <
typename T>
1727 const std::string & error_string)
const 1731 T param = this->get<T>(
name);
1737 return this->get<T>(
name);
1740 template <
typename T>
1745 checkConsistentType<T>(
name);
1747 InputParameters::insert<T>(
name);
1749 metadata._required =
true;
1750 if constexpr (isFunctorNameType<T>())
1751 metadata._doc_string = appendFunctorDescription<T>(doc_string);
1753 metadata._doc_string = doc_string;
1756 template <
typename T>
1760 const std::string & )
1762 mooseError(
"You cannot call addRequiredParam and supply a default value for this type, please " 1763 "use addParam instead");
1766 template <
typename T,
typename S>
1771 checkConsistentType<T>(
name);
1773 T & l_value = InputParameters::set<T>(
name);
1775 if constexpr (isFunctorNameType<T>())
1776 metadata._doc_string = appendFunctorDescription<T>(doc_string);
1778 metadata._doc_string = doc_string;
1786 metadata._set_by_add_param =
true;
1789 template <
typename T>
1794 checkConsistentType<T>(
name);
1796 InputParameters::insert<T>(
name);
1797 if constexpr (isFunctorNameType<T>())
1798 _params[
name]._doc_string = appendFunctorDescription<T>(doc_string);
1803 template <
typename T,
typename S>
1810 template <
typename T>
1813 const std::string &
syntax,
1814 const bool required,
1815 const bool value_required)
1818 "This type is not a supported command line parameter type. See " 1819 "CommandLine::populateCommandLineParams to add it as a supported type.");
1825 std::vector<std::string> syntax_split;
1830 mooseAssert(cl_data->syntax.size(),
"Empty token");
1834 for (
const auto & val : syntax_split)
1835 if (val.rfind(
"-", 0) == 0)
1837 if (!std::regex_search(val, std::regex(
"^\\-+[a-zA-Z]")))
1840 "' for the command line parameter '",
1842 "' is invalid. It must begin with an alphabetical character.");
1844 cl_data->switches.push_back(val);
1848 cl_data->required = required;
1849 cl_data->global =
false;
1852 if constexpr (std::is_same_v<T, bool>)
1854 (
void)value_required;
1858 else if constexpr (std::is_same_v<T, MooseEnum>)
1860 (
void)value_required;
1861 cl_data->argument_type = CommandLineMetadata::ArgumentType::REQUIRED;
1864 else if (value_required)
1865 cl_data->argument_type = CommandLineMetadata::ArgumentType::REQUIRED;
1868 cl_data->argument_type = CommandLineMetadata::ArgumentType::OPTIONAL;
1871 template <
typename T>
1874 const std::string & parsed_function,
1875 const std::string & doc_string)
1877 addRequiredParam<T>(
name, doc_string);
1881 template <
typename T>
1885 const std::string & parsed_function,
1886 const std::string & doc_string)
1892 template <
typename T>
1895 const std::string & parsed_function,
1896 const std::string & doc_string)
1898 addParam<T>(
name, doc_string);
1902 template <
typename T>
1905 const std::string & custom_type,
1906 const std::string & doc_string)
1908 addRequiredParam<T>(
name, doc_string);
1912 template <
typename T>
1916 const std::string & custom_type,
1917 const std::string & doc_string)
1923 template <
typename T>
1926 const std::string & custom_type,
1927 const std::string & doc_string)
1929 addParam<T>(
name, doc_string);
1933 template <
typename T>
1936 const std::string & custom_type,
1937 const std::string & doc_string,
1938 const std::string & deprecation_message)
1941 addParam<T>(
name, doc_string);
1943 metadata._custom_type = custom_type;
1945 metadata._deprecation_message = deprecation_message;
1949 template <
typename T>
1954 checkConsistentType<T>(
name);
1956 InputParameters::insert<T>(
name);
1960 template <
typename T>
1965 checkConsistentType<T>(
name);
1969 metadata._is_private =
true;
1970 metadata._set_by_add_param =
true;
1973 template <
typename T>
1976 const std::string &
syntax,
1977 const std::string & doc_string)
1979 static_assert(!std::is_same_v<T, bool>,
"Cannot be used for a bool");
1981 addRequiredParam<T>(
name, doc_string);
1982 addCommandLineParamHelper<T>(
name,
syntax,
true,
true);
1985 template <
typename T>
1988 const std::string &
syntax,
1989 const std::string & doc_string)
1991 static_assert(!std::is_same_v<T, MooseEnum>,
1992 "addCommandLineParam() without a value cannot be used with a MooseEnum because a " 1993 "MooseEnum requires initialization");
1995 auto constexpr is_bool = std::is_same_v<T, bool>;
1996 if constexpr (is_bool)
1997 addParam<T>(
name,
false, doc_string);
1999 addParam<T>(
name, doc_string);
2001 addCommandLineParamHelper<T>(
2005 template <
typename T>
2008 const std::string &
syntax,
2010 const std::string & doc_string)
2012 if constexpr (std::is_same_v<T, bool>)
2013 mooseAssert(!
value,
"Default for bool must be false");
2016 addCommandLineParamHelper<T>(
name,
syntax,
false,
true);
2019 template <
typename T>
2022 const std::string &
syntax,
2024 const std::string & doc_string)
2026 mooseAssert(
name ==
"mesh_only" ||
name ==
"recover" ||
name ==
"run",
2027 "Not supported for new parameters");
2028 static_assert(!std::is_same_v<T, bool>,
"Cannot be used for a bool (does not take a value)");
2030 addCommandLineParamHelper<T>(
name,
syntax,
false,
false);
2033 template <
typename T>
2046 if (!this->Parameters::have_parameter<T>(
name))
2051 ")\nbut the parameter already exists as type (",
2056 template <
typename T>
2061 if (!this->have_parameter<T>(
name))
2065 metadata._required =
false;
2066 metadata._is_private =
true;
2067 metadata._controllable =
false;
2070 template <
typename T>
2075 suppressParameter<T>(
name);
2079 template <
typename T>
2085 if (!this->have_parameter<T>(
name))
2091 template <
typename T>
2097 if (!this->have_parameter<T>(
name))
2098 mooseError(
"Unable to un-require nonexistent parameter: ",
name);
2103 template <
typename T>
2107 const std::string & doc_string,
2108 const std::string & deprecation_message)
2112 "Attempting to deprecate via addDeprecatedParam the parameter, '" 2113 <<
name <<
"', already deprecated via deprecateParam or renamed via renameParam");
2116 _params[
name]._deprecation_message = deprecation_message;
2120 template <
typename T>
2123 const std::string & doc_string,
2124 const std::string & deprecation_message)
2128 "Attempting to deprecate via addDeprecatedParam the parameter, '" 2129 <<
name <<
"', already deprecated via deprecateParam or renamed via renameParam");
2130 addParam<T>(
name, doc_string);
2132 _params[
name]._deprecation_message = deprecation_message;
2138 void InputParameters::addRequiredParam<MooseEnum>(
const std::string &
name,
2140 const std::string & doc_string);
2143 void InputParameters::addRequiredParam<MultiMooseEnum>(
const std::string &
name,
2145 const std::string & doc_string);
2148 void InputParameters::addRequiredParam<std::vector<MooseEnum>>(
2149 const std::string &
name,
2150 const std::vector<MooseEnum> & moose_enums,
2151 const std::string & doc_string);
2154 void InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
2155 const std::string &
name,
2156 const std::vector<MultiMooseEnum> & moose_enums,
2157 const std::string & doc_string);
2160 void InputParameters::addParam<MooseEnum>(
const std::string & ,
2161 const std::string & );
2164 void InputParameters::addParam<MultiMooseEnum>(
const std::string & ,
2165 const std::string & );
2168 void InputParameters::addParam<std::vector<MooseEnum>>(
const std::string & ,
2169 const std::string & );
2172 void InputParameters::addParam<std::vector<MultiMooseEnum>>(
const std::string & ,
2173 const std::string & );
2177 InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
const std::string & ,
2178 const std::string & );
2181 void InputParameters::addPrivateParam<MooseEnum>(
const std::string & );
2184 void InputParameters::addPrivateParam<MultiMooseEnum>(
const std::string & );
2187 void InputParameters::addDeprecatedParam<MooseEnum>(
const std::string & ,
2188 const std::string & ,
2189 const std::string & );
2193 InputParameters::addDeprecatedParam<MultiMooseEnum>(
const std::string & ,
2194 const std::string & ,
2195 const std::string & );
2198 void InputParameters::addDeprecatedParam<std::vector<MooseEnum>>(
2199 const std::string & ,
2200 const std::string & ,
2201 const std::string & );
2205 void InputParameters::setParamHelper<PostprocessorName, Real>(
const std::string &
name,
2206 PostprocessorName & l_value,
2207 const Real & r_value);
2210 void InputParameters::setParamHelper<PostprocessorName, int>(
const std::string &
name,
2211 PostprocessorName & l_value,
2212 const int & r_value);
2215 void InputParameters::setParamHelper<FunctionName, Real>(
const std::string & ,
2216 FunctionName & l_value,
2217 const Real & r_value);
2220 void InputParameters::setParamHelper<FunctionName, int>(
const std::string & ,
2221 FunctionName & l_value,
2222 const int & r_value);
2225 void InputParameters::setParamHelper<MaterialPropertyName, Real>(
const std::string & ,
2226 MaterialPropertyName & l_value,
2227 const Real & r_value);
2230 void InputParameters::setParamHelper<MaterialPropertyName, int>(
const std::string & ,
2231 MaterialPropertyName & l_value,
2232 const int & r_value);
2235 void InputParameters::setParamHelper<MooseFunctorName, Real>(
const std::string & ,
2236 MooseFunctorName & l_value,
2237 const Real & r_value);
2240 void InputParameters::setParamHelper<MooseFunctorName, int>(
const std::string & ,
2241 MooseFunctorName & l_value,
2242 const int & r_value);
2244 template <
typename T>
2251 pars.
mooseError(
"The parameter \"",
name,
"\" is being retrieved before being set.");
2260 const MooseEnum & InputParameters::getParamHelper<MooseEnum>(
const std::string &
name,
2265 InputParameters::getParamHelper<MultiMooseEnum>(
const std::string &
name,
2268 template <
typename R1,
typename R2,
typename V1,
typename V2>
2269 std::vector<std::pair<R1, R2>>
2275 const auto & v1 = get<V1>(param1);
2276 const auto & v2 = get<V2>(param2);
2279 if (controllable.count(param1) || controllable.count(param2))
2283 param2 +
" are controllable parameters and cannot be retireved using " 2284 "the MooseObject::getParam/InputParameters::get methods for pairs");
2286 if (v1.size() != v2.size())
2288 "Vector parameters ",
2295 ") are of different lengths \n");
2297 std::vector<std::pair<R1, R2>> parameter_pairs;
2298 auto i1 = v1.begin();
2299 auto i2 = v2.begin();
2300 for (; i1 != v1.end() && i2 != v2.end(); ++i1, ++i2)
2301 parameter_pairs.emplace_back(std::make_pair(*i1, *i2));
2302 return parameter_pairs;
2307 template <
typename T>
2315 return have_parameter<T>(
name);
2318 template <
typename T>
2324 return Parameters::get<T>(
name);
2327 template <
typename T>
2333 return Parameters::have_parameter<T>(
name);
2336 template <
typename T>
2339 const std::string & name_in,
2340 const std::string & new_name,
2341 const std::string & new_description)
2344 const auto p_name = new_name.empty() ? name_in : new_name;
2348 "' parameter could not be transferred because it does not exist with type '",
2349 MooseUtils::prettyCppType<T>(),
2350 "' in the source parameters");
2351 if (
name != name_in)
2352 mooseWarning(
"The transferred parameter " + name_in +
" is deprecated in favor of " +
name +
2353 " in the source parameters. The new name should likely be used for the parameter " 2354 "transfer instead.");
2355 const std::string description =
2364 else if constexpr (std::is_same_v<MooseEnum, T> || std::is_same_v<MultiMooseEnum, T>)
2365 addRequiredParam<T>(p_name, source_params.
get<T>(
name), description);
2367 addRequiredRangeCheckedParam<T>(
2370 addRequiredParam<T>(p_name, description);
2383 std::vector<Real> coupled_values;
2392 addRangeCheckedParam<T>(p_name,
2399 else if constexpr (std::is_same_v<MooseEnum, T> || std::is_same_v<MultiMooseEnum, T>)
2400 addParam<T>(p_name, source_params.
get<T>(
name), description);
2404 addParam<T>(p_name, source_params.
get<T>(
name), description);
2406 addParam<T>(p_name, description);
2412 _params[p_name]._is_private =
true;
2414 _params[p_name]._controllable =
true;
2417 template <
typename... Args>
2421 std::ostringstream oss;
2426 template <
typename... Args>
2430 std::ostringstream oss;
2435 template <
typename... Args>
2439 std::ostringstream oss;
2452 template <
typename T>
2459 #ifdef MOOSE_MFEM_ENABLED 2461 template <
typename T>
2465 return std::is_same_v<T, MFEMScalarCoefficientName> ||
2466 std::is_same_v<T, MFEMVectorCoefficientName>;
2469 template <
typename T,
typename A>
2478 template <
typename T>
2482 return std::is_same_v<T, MooseFunctorName>
2483 #ifdef MOOSE_MFEM_ENABLED 2484 || std::is_same_v<T, MFEMScalarCoefficientName>
2489 template <
typename T,
typename A>
2496 template <
typename T>
2500 #ifdef MOOSE_MFEM_ENABLED 2501 return std::is_same_v<T, MFEMVectorCoefficientName>;
2507 template <
typename T,
typename A>
2514 template <
typename T>
2523 template <
typename T>
2530 template <
typename T>
2534 auto numeric_value_type = []()
2537 Moose::internal::getNullptrExample<T>()))
2540 Moose::internal::getNullptrExample<T>()))
2541 return "numeric vector value (enclosed in curly braces)";
2544 mooseAssert(
false,
"We control instantiations of this method");
2549 return MooseUtils::trim(doc_string,
". ") +
". A functor is any of the following: a variable, " +
2551 #ifdef MOOSE_MFEM_ENABLED 2557 " 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...
bool show_trace
Set to true (the default) to print the stack trace with error and warning messages - false to omit it...
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.
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
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...
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.