21 #include "libmesh/parameters.h" 23 #ifdef LIBMESH_HAVE_FPARSER 24 #include "libmesh/fparser.hh" 33 #include <unordered_map> 39 #include <gtest/gtest.h> 73 virtual void clear()
override;
137 template <
typename T>
141 std::is_same_v<T, std::string> || std::is_same_v<T, std::vector<std::string>> ||
142 std::is_same_v<T, Real> || std::is_same_v<T, unsigned int> || std::is_same_v<T, int> ||
143 std::is_same_v<T, bool> || std::is_same_v<T, MooseEnum>;
160 virtual void set_attributes(
const std::string & name,
bool inserted_only)
override;
168 template <
typename T>
169 void setHelper(
const std::string & name);
186 template <
typename T>
187 T &
set(
const std::string &
name,
bool quiet_mode =
false);
200 template <
typename T,
typename... Ts>
201 void setParameters(
const std::string & name,
const T & value, Ts... extra_input_parameters);
210 template <
typename T,
typename UP_T>
212 std::optional<std::pair<bool, std::string>>
rangeCheck(
const std::string & full_name,
213 const std::string & short_name,
214 InputParameters::Parameter<T> * param,
215 const bool include_param_path =
true);
216 template <
typename T,
typename UP_T>
217 std::optional<std::pair<bool, std::string>>
219 const std::string & short_name,
220 InputParameters::Parameter<std::vector<T>> * param,
221 const bool include_param_path =
true);
227 template <
typename T>
235 template <
typename T>
236 void addRequiredParam(
const std::string & name,
const std::string & doc_string);
242 template <
typename T>
244 addRequiredParam(
const std::string & name,
const T & moose_enum,
const std::string & doc_string);
253 template <
typename T,
typename S>
254 void addParam(
const std::string & name,
const S & value,
const std::string & doc_string);
255 template <
typename T>
256 void addParam(
const std::string & name,
const std::string & doc_string);
262 template <
typename T>
264 const std::initializer_list<typename T::value_type> & value,
265 const std::string & doc_string)
276 template <
typename T>
278 const std::string & parsed_function,
279 const std::string & doc_string);
280 template <
typename T>
283 const std::string & parsed_function,
284 const std::string & doc_string);
285 template <
typename T>
287 const std::string & parsed_function,
288 const std::string & doc_string);
296 template <
typename T>
298 const std::string & custom_type,
299 const std::string & doc_string);
300 template <
typename T>
303 const std::string & custom_type,
304 const std::string & doc_string);
305 template <
typename T>
307 const std::string & custom_type,
308 const std::string & doc_string);
309 template <
typename T>
311 const std::string & custom_type,
312 const std::string & doc_string,
313 const std::string & deprecation_msg);
321 template <
typename T>
323 template <
typename T>
335 template <
typename T>
337 const std::string & syntax,
338 const std::string & doc_string);
339 template <
typename T>
341 const std::string & syntax,
342 const std::string & doc_string);
343 template <
typename T>
345 const std::string & syntax,
347 const std::string & doc_string);
348 template <
typename T>
350 const std::string & syntax,
351 const std::initializer_list<typename T::value_type> & value,
352 const std::string & doc_string)
354 addCommandLineParam<T>(
name, syntax, T{
value}, doc_string);
374 template <
typename T>
376 const std::string & syntax,
378 const std::string & doc_string);
394 template <
typename T>
397 const std::string & doc_string,
398 const std::string & deprecation_message);
400 template <
typename T>
402 const std::string & doc_string,
403 const std::string & deprecation_message);
414 template <
typename T>
427 std::optional<InputParameters::CommandLineMetadata>
443 FRIEND_TEST(InputParametersTest, commandLineParamSetNotCLParam);
457 const std::string &
getDescription(
const std::string & name)
const;
477 std::string
getGroupName(
const std::string & param_name)
const;
485 template <
typename T>
492 template <
typename T>
499 template <
typename T>
507 void addCoupledVar(
const std::string & name,
const std::string & doc_string);
517 const std::string & new_name,
518 const std::string & removal_date =
"");
528 void addCoupledVar(
const std::string & name,
const Real value,
const std::string & doc_string);
539 const std::vector<Real> & value,
540 const std::string & doc_string);
561 const std::string & base_name,
562 const std::string & num_name,
563 const std::string & doc_string);
565 const std::string & base_name,
566 const std::string & num_name,
567 const std::string & doc_string);
575 std::string
getMooseType(
const std::string & name)
const;
576 std::vector<std::string>
getVecMooseType(
const std::string & name)
const;
609 std::string
getDocString(
const std::string & name)
const;
618 void setDocString(
const std::string & name,
const std::string & doc);
623 std::string
getDocUnit(
const std::string & name)
const;
631 void setDocUnit(
const std::string & name,
const std::string & doc_unit);
671 std::string
type(
const std::string & name)
const;
676 bool isPrivate(
const std::string & name)
const;
717 const std::string &
getBase()
const;
762 const std::string & name,
779 const std::vector<std::tuple<std::string,
806 using Parameters::operator=;
807 using Parameters::operator+=;
818 void checkParams(
const std::string & parsing_syntax);
827 void finalize(
const std::string & parsing_syntax);
842 std::filesystem::path
843 getFileBase(
const std::optional<std::string> & param_name = std::optional<std::string>())
const;
878 bool hasDefault(
const std::string & param_name)
const;
916 void defaultCoupledValue(
const std::string & coupling_name, Real value,
unsigned int i = 0);
942 const std::vector<std::string> & exclude = {},
943 const bool allow_private =
false);
963 const std::vector<std::string> & include,
964 bool allow_private =
false);
979 const std::string & common_name,
980 bool allow_private =
false,
981 bool override_default =
false);
1020 template <
typename T>
1027 template <
typename R1,
1029 typename V1 =
typename std::conditional<std::is_same<R1, MooseEnumItem>::value,
1032 typename V2 =
typename std::conditional<std::is_same<R2, MooseEnumItem>::value,
1035 std::vector<std::pair<R1, R2>>
get(
const std::string & param1,
const std::string & param2)
const;
1056 void setReservedValues(
const std::string & name,
const std::set<std::string> & reserved);
1062 std::set<std::string>
reservedValues(
const std::string & name)
const;
1079 const hit::Node *
getHitNode(
const std::string & param)
const;
1085 void setHitNode(
const std::string & param,
const hit::Node & node,
const SetParamHitNodeKey);
1111 template <
typename... Args>
1112 std::string
paramMessage(
const std::string & param, Args... args)
const;
1117 template <
typename... Args>
1118 [[noreturn]]
void mooseError(Args &&... args)
const;
1124 template <
typename... Args>
1125 [[noreturn]]
void paramError(
const std::string & param, Args... args)
const;
1131 std::string
rawParamVal(
const std::string & param)
const;
1137 template <
typename T>
1149 template <
typename T>
1150 bool isType(
const std::string & name)
const;
1158 std::string
varName(
const std::string & var_param_name,
1159 const std::string & moose_object_with_var_param_name)
const;
1169 const std::string & new_name,
1170 const std::string & new_docstring);
1179 const std::string & new_name,
1180 const std::string & new_docstring);
1183 const std::string & new_name,
1184 const std::string & removal_date);
1187 const std::string & new_name,
1188 const std::string & removal_date);
1204 template <
typename T>
1205 const T &
get(std::string_view
name)
const;
1215 template <
typename T>
1225 template <
typename T>
1227 const std::string & name,
1228 const std::string & new_name =
"",
1229 const std::string & new_description =
"");
1243 std::vector<std::string>
paramAliases(
const std::string & param_name)
const;
1278 template <
typename T>
1284 template <
typename T>
1293 const std::string & new_name,
1295 const std::string & removal_date);
1298 const std::string & new_name,
1300 const std::string & removal_date);
1308 std::pair<std::string, const hit::Node *>
paramMessageContext(
const std::string & param)
const;
1365 if (
_params.count(param) == 0)
1366 mooseError(
"param '", param,
"' not present in InputParams");
1372 if (
_params.count(param) == 0)
1373 mooseError(
"param '", param,
"' not present in InputParams");
1397 template <
typename T,
typename S>
1398 void setParamHelper(
const std::string & name, T & l_value,
const S & r_value);
1408 template <
typename T>
1410 const std::string & syntax,
1411 const bool required,
1412 const bool value_required);
1419 const bool with_prefix =
true,
1420 const hit::Node * node =
nullptr)
const;
1441 std::vector<std::tuple<std::string,
1487 template <
typename T>
1494 template <
typename T>
1501 checkConsistentType<T>(
name);
1503 T & result = this->Parameters::set<T>(
name);
1513 template <
typename T,
typename... Ts>
1517 Ts... extra_input_parameters)
1523 template <
typename T,
typename UP_T>
1524 std::optional<std::pair<bool, std::string>>
1526 const std::string & short_name,
1527 InputParameters::Parameter<std::vector<T>> * param,
1528 const bool include_param_path)
1530 mooseAssert(param,
"Parameter is NULL");
1535 const auto & range_function =
_params[short_name]._range_function;
1536 if (range_function.empty())
1551 std::vector<std::string>
vars;
1552 if (fp.ParseAndDeduceVariables(range_function,
vars) != -1)
1554 "Error parsing expression '" + range_function +
"' for parameter " + short_name +
""}};
1557 std::vector<UP_T> parbuf(
vars.size());
1560 const std::vector<T> &
value = param->set();
1563 bool need_to_iterate =
false;
1568 for (
unsigned int j = 0; j <
vars.size(); j++)
1570 if (
vars[j] == short_name)
1572 if (
value.size() == 0)
1573 return {{
true,
"Range checking empty vector '" + range_function +
"'"}};
1575 parbuf[j] =
value[i];
1576 need_to_iterate =
true;
1578 else if (
vars[j] == short_name +
"_size")
1579 parbuf[j] =
value.size();
1582 if (
vars[j].substr(0, short_name.size() + 1) != short_name +
"_")
1583 return {{
false,
"Error parsing expression '" + range_function +
"'"}};
1584 std::istringstream iss(
vars[j]);
1585 iss.seekg(short_name.size() + 1);
1588 if (iss >> index && iss.eof())
1590 if (index >=
value.size())
1592 "Error parsing expression '" + range_function +
"'; out of range variable '" +
1594 parbuf[j] =
value[index];
1598 "Error parsing expression '" + range_function +
"'; invalid variable '" +
1605 auto tmp_eps = fp.epsilon();
1607 UP_T result = fp.Eval(&parbuf[0]);
1608 fp.setEpsilon(tmp_eps);
1612 return {{
false,
"Error evaluating expression '" + range_function +
"'"}};
1616 std::ostringstream oss;
1617 oss <<
"Range check failed";
1618 if (include_param_path)
1619 oss <<
" for parameter " << full_name;
1620 oss <<
"; expression = '" << range_function <<
"'";
1621 if (need_to_iterate)
1622 oss <<
", component " << i;
1623 return {{
true, oss.str()}};
1626 }
while (need_to_iterate && ++i <
value.size());
1631 template <
typename T,
typename UP_T>
1632 std::optional<std::pair<bool, std::string>>
1634 const std::string & short_name,
1635 InputParameters::Parameter<T> * param,
1636 const bool include_param_path)
1638 mooseAssert(param,
"Parameter is NULL");
1643 const auto & range_function =
_params[short_name]._range_function;
1644 if (range_function.empty())
1649 if (fp.Parse(range_function, short_name) != -1)
1651 "Error parsing expression '" + range_function +
"'" +
" for parameter " + short_name}};
1655 auto tmp_eps = fp.epsilon();
1658 std::vector<UP_T>
value(1, param->set());
1659 UP_T result = fp.Eval(&
value[0]);
1660 fp.setEpsilon(tmp_eps);
1664 "Error evaluating expression '" + range_function +
"' for parameter " + short_name +
1665 "; perhaps you used the wrong variable name?"}};
1669 std::ostringstream oss;
1670 oss <<
"Range check failed";
1671 if (include_param_path)
1672 oss <<
" for parameter " << full_name;
1673 oss <<
"; expression = '" << range_function <<
"', value = " <<
value[0];
1674 return {{
true, oss.str()}};
1680 template <
typename T>
1683 const std::string & error_string)
const 1687 T param = this->get<T>(
name);
1693 return this->get<T>(
name);
1696 template <
typename T>
1701 checkConsistentType<T>(
name);
1703 InputParameters::insert<T>(
name);
1705 metadata._required =
true;
1706 if constexpr (isFunctorNameType<T>())
1707 metadata._doc_string = appendFunctorDescription<T>(doc_string);
1709 metadata._doc_string = doc_string;
1712 template <
typename T>
1716 const std::string & )
1718 mooseError(
"You cannot call addRequiredParam and supply a default value for this type, please " 1719 "use addParam instead");
1722 template <
typename T,
typename S>
1727 checkConsistentType<T>(
name);
1729 T & l_value = InputParameters::set<T>(
name);
1731 if constexpr (isFunctorNameType<T>())
1732 metadata._doc_string = appendFunctorDescription<T>(doc_string);
1734 metadata._doc_string = doc_string;
1742 metadata._set_by_add_param =
true;
1745 template <
typename T>
1750 checkConsistentType<T>(
name);
1752 InputParameters::insert<T>(
name);
1753 if constexpr (isFunctorNameType<T>())
1754 _params[
name]._doc_string = appendFunctorDescription<T>(doc_string);
1759 template <
typename T,
typename S>
1766 template <
typename T>
1769 const std::string &
syntax,
1770 const bool required,
1771 const bool value_required)
1774 "This type is not a supported command line parameter type. See " 1775 "CommandLine::populateCommandLineParams to add it as a supported type.");
1781 std::vector<std::string> syntax_split;
1786 mooseAssert(cl_data->syntax.size(),
"Empty token");
1790 for (
const auto & val : syntax_split)
1791 if (val.rfind(
"-", 0) == 0)
1793 if (!std::regex_search(val, std::regex(
"^\\-+[a-zA-Z]")))
1796 "' for the command line parameter '",
1798 "' is invalid. It must begin with an alphabetical character.");
1800 cl_data->switches.push_back(val);
1804 cl_data->required = required;
1805 cl_data->global =
false;
1808 if constexpr (std::is_same_v<T, bool>)
1810 (
void)value_required;
1814 else if constexpr (std::is_same_v<T, MooseEnum>)
1816 (
void)value_required;
1817 cl_data->argument_type = CommandLineMetadata::ArgumentType::REQUIRED;
1820 else if (value_required)
1821 cl_data->argument_type = CommandLineMetadata::ArgumentType::REQUIRED;
1824 cl_data->argument_type = CommandLineMetadata::ArgumentType::OPTIONAL;
1827 template <
typename T>
1830 const std::string & parsed_function,
1831 const std::string & doc_string)
1833 addRequiredParam<T>(
name, doc_string);
1837 template <
typename T>
1841 const std::string & parsed_function,
1842 const std::string & doc_string)
1848 template <
typename T>
1851 const std::string & parsed_function,
1852 const std::string & doc_string)
1854 addParam<T>(
name, doc_string);
1858 template <
typename T>
1861 const std::string & custom_type,
1862 const std::string & doc_string)
1864 addRequiredParam<T>(
name, doc_string);
1868 template <
typename T>
1872 const std::string & custom_type,
1873 const std::string & doc_string)
1879 template <
typename T>
1882 const std::string & custom_type,
1883 const std::string & doc_string)
1885 addParam<T>(
name, doc_string);
1889 template <
typename T>
1892 const std::string & custom_type,
1893 const std::string & doc_string,
1894 const std::string & deprecation_message)
1897 addParam<T>(
name, doc_string);
1899 metadata._custom_type = custom_type;
1901 metadata._deprecation_message = deprecation_message;
1905 template <
typename T>
1910 checkConsistentType<T>(
name);
1912 InputParameters::insert<T>(
name);
1916 template <
typename T>
1921 checkConsistentType<T>(
name);
1925 metadata._is_private =
true;
1926 metadata._set_by_add_param =
true;
1929 template <
typename T>
1932 const std::string &
syntax,
1933 const std::string & doc_string)
1935 static_assert(!std::is_same_v<T, bool>,
"Cannot be used for a bool");
1937 addRequiredParam<T>(
name, doc_string);
1938 addCommandLineParamHelper<T>(
name,
syntax,
true,
true);
1941 template <
typename T>
1944 const std::string &
syntax,
1945 const std::string & doc_string)
1947 static_assert(!std::is_same_v<T, MooseEnum>,
1948 "addCommandLineParam() without a value cannot be used with a MooseEnum because a " 1949 "MooseEnum requires initialization");
1951 auto constexpr is_bool = std::is_same_v<T, bool>;
1952 if constexpr (is_bool)
1953 addParam<T>(
name,
false, doc_string);
1955 addParam<T>(
name, doc_string);
1957 addCommandLineParamHelper<T>(
1961 template <
typename T>
1964 const std::string &
syntax,
1966 const std::string & doc_string)
1968 if constexpr (std::is_same_v<T, bool>)
1969 mooseAssert(!
value,
"Default for bool must be false");
1972 addCommandLineParamHelper<T>(
name,
syntax,
false,
true);
1975 template <
typename T>
1978 const std::string &
syntax,
1980 const std::string & doc_string)
1982 mooseAssert(
name ==
"mesh_only" ||
name ==
"recover" ||
name ==
"run",
1983 "Not supported for new parameters");
1984 static_assert(!std::is_same_v<T, bool>,
"Cannot be used for a bool (does not take a value)");
1986 addCommandLineParamHelper<T>(
name,
syntax,
false,
false);
1989 template <
typename T>
2002 if (!this->Parameters::have_parameter<T>(
name))
2007 ")\nbut the parameter already exists as type (",
2012 template <
typename T>
2017 if (!this->have_parameter<T>(
name))
2021 metadata._required =
false;
2022 metadata._is_private =
true;
2023 metadata._controllable =
false;
2026 template <
typename T>
2031 suppressParameter<T>(
name);
2035 template <
typename T>
2041 if (!this->have_parameter<T>(
name))
2047 template <
typename T>
2053 if (!this->have_parameter<T>(
name))
2054 mooseError(
"Unable to un-require nonexistent parameter: ",
name);
2059 template <
typename T>
2063 const std::string & doc_string,
2064 const std::string & deprecation_message)
2068 "Attempting to deprecate via addDeprecatedParam the parameter, '" 2069 <<
name <<
"', already deprecated via deprecateParam or renamed via renameParam");
2072 _params[
name]._deprecation_message = deprecation_message;
2076 template <
typename T>
2079 const std::string & doc_string,
2080 const std::string & deprecation_message)
2084 "Attempting to deprecate via addDeprecatedParam the parameter, '" 2085 <<
name <<
"', already deprecated via deprecateParam or renamed via renameParam");
2086 addParam<T>(
name, doc_string);
2088 _params[
name]._deprecation_message = deprecation_message;
2094 void InputParameters::addRequiredParam<MooseEnum>(
const std::string &
name,
2096 const std::string & doc_string);
2099 void InputParameters::addRequiredParam<MultiMooseEnum>(
const std::string &
name,
2101 const std::string & doc_string);
2104 void InputParameters::addRequiredParam<std::vector<MooseEnum>>(
2105 const std::string &
name,
2106 const std::vector<MooseEnum> & moose_enums,
2107 const std::string & doc_string);
2110 void InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
2111 const std::string &
name,
2112 const std::vector<MultiMooseEnum> & moose_enums,
2113 const std::string & doc_string);
2116 void InputParameters::addParam<MooseEnum>(
const std::string & ,
2117 const std::string & );
2120 void InputParameters::addParam<MultiMooseEnum>(
const std::string & ,
2121 const std::string & );
2124 void InputParameters::addParam<std::vector<MooseEnum>>(
const std::string & ,
2125 const std::string & );
2128 void InputParameters::addParam<std::vector<MultiMooseEnum>>(
const std::string & ,
2129 const std::string & );
2133 InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
const std::string & ,
2134 const std::string & );
2137 void InputParameters::addPrivateParam<MooseEnum>(
const std::string & );
2140 void InputParameters::addPrivateParam<MultiMooseEnum>(
const std::string & );
2143 void InputParameters::addDeprecatedParam<MooseEnum>(
const std::string & ,
2144 const std::string & ,
2145 const std::string & );
2149 InputParameters::addDeprecatedParam<MultiMooseEnum>(
const std::string & ,
2150 const std::string & ,
2151 const std::string & );
2154 void InputParameters::addDeprecatedParam<std::vector<MooseEnum>>(
2155 const std::string & ,
2156 const std::string & ,
2157 const std::string & );
2161 void InputParameters::setParamHelper<PostprocessorName, Real>(
const std::string &
name,
2162 PostprocessorName & l_value,
2163 const Real & r_value);
2166 void InputParameters::setParamHelper<PostprocessorName, int>(
const std::string &
name,
2167 PostprocessorName & l_value,
2168 const int & r_value);
2171 void InputParameters::setParamHelper<FunctionName, Real>(
const std::string & ,
2172 FunctionName & l_value,
2173 const Real & r_value);
2176 void InputParameters::setParamHelper<FunctionName, int>(
const std::string & ,
2177 FunctionName & l_value,
2178 const int & r_value);
2181 void InputParameters::setParamHelper<MaterialPropertyName, Real>(
const std::string & ,
2182 MaterialPropertyName & l_value,
2183 const Real & r_value);
2186 void InputParameters::setParamHelper<MaterialPropertyName, int>(
const std::string & ,
2187 MaterialPropertyName & l_value,
2188 const int & r_value);
2191 void InputParameters::setParamHelper<MooseFunctorName, Real>(
const std::string & ,
2192 MooseFunctorName & l_value,
2193 const Real & r_value);
2196 void InputParameters::setParamHelper<MooseFunctorName, int>(
const std::string & ,
2197 MooseFunctorName & l_value,
2198 const int & r_value);
2200 template <
typename T>
2207 pars.
mooseError(
"The parameter \"",
name,
"\" is being retrieved before being set.");
2216 const MooseEnum & InputParameters::getParamHelper<MooseEnum>(
const std::string &
name,
2221 InputParameters::getParamHelper<MultiMooseEnum>(
const std::string &
name,
2224 template <
typename R1,
typename R2,
typename V1,
typename V2>
2225 std::vector<std::pair<R1, R2>>
2231 const auto & v1 = get<V1>(param1);
2232 const auto & v2 = get<V2>(param2);
2235 if (controllable.count(param1) || controllable.count(param2))
2239 param2 +
" are controllable parameters and cannot be retireved using " 2240 "the MooseObject::getParam/InputParameters::get methods for pairs");
2242 if (v1.size() != v2.size())
2244 "Vector parameters ",
2251 ") are of different lengths \n");
2253 std::vector<std::pair<R1, R2>> parameter_pairs;
2254 auto i1 = v1.begin();
2255 auto i2 = v2.begin();
2256 for (; i1 != v1.end() && i2 != v2.end(); ++i1, ++i2)
2257 parameter_pairs.emplace_back(std::make_pair(*i1, *i2));
2258 return parameter_pairs;
2263 template <
typename T>
2271 return have_parameter<T>(
name);
2274 template <
typename T>
2280 return Parameters::get<T>(
name);
2283 template <
typename T>
2289 return Parameters::have_parameter<T>(
name);
2292 template <
typename T>
2295 const std::string & name_in,
2296 const std::string & new_name,
2297 const std::string & new_description)
2300 const auto p_name = new_name.empty() ? name_in : new_name;
2304 "' parameter could not be transferred because it does not exist with type '",
2305 MooseUtils::prettyCppType<T>(),
2306 "' in the source parameters");
2307 if (
name != name_in)
2308 mooseWarning(
"The transferred parameter " + name_in +
" is deprecated in favor of " +
name +
2309 " in the source parameters. The new name should likely be used for the parameter " 2310 "transfer instead.");
2311 const std::string description =
2320 else if constexpr (std::is_same_v<MooseEnum, T> || std::is_same_v<MultiMooseEnum, T>)
2321 addRequiredParam<T>(p_name, source_params.
get<T>(
name), description);
2323 addRequiredRangeCheckedParam<T>(
2326 addRequiredParam<T>(p_name, description);
2339 std::vector<Real> coupled_values;
2348 addRangeCheckedParam<T>(p_name,
2355 else if constexpr (std::is_same_v<MooseEnum, T> || std::is_same_v<MultiMooseEnum, T>)
2356 addParam<T>(p_name, source_params.
get<T>(
name), description);
2360 addParam<T>(p_name, source_params.
get<T>(
name), description);
2362 addParam<T>(p_name, description);
2368 _params[p_name]._is_private =
true;
2370 _params[p_name]._controllable =
true;
2373 template <
typename... Args>
2377 std::ostringstream oss;
2382 template <
typename... Args>
2386 std::ostringstream oss;
2391 template <
typename... Args>
2395 std::ostringstream oss;
2408 template <
typename T>
2415 #ifdef MOOSE_MFEM_ENABLED 2417 template <
typename T>
2421 return std::is_same_v<T, MFEMScalarCoefficientName> ||
2422 std::is_same_v<T, MFEMVectorCoefficientName>;
2425 template <
typename T,
typename A>
2434 template <
typename T>
2438 return std::is_same_v<T, MooseFunctorName>
2439 #ifdef MOOSE_MFEM_ENABLED 2440 || std::is_same_v<T, MFEMScalarCoefficientName>
2445 template <
typename T,
typename A>
2452 template <
typename T>
2456 #ifdef MOOSE_MFEM_ENABLED 2457 return std::is_same_v<T, MFEMVectorCoefficientName>;
2463 template <
typename T,
typename A>
2470 template <
typename T>
2479 template <
typename T>
2486 template <
typename T>
2490 auto numeric_value_type = []()
2493 Moose::internal::getNullptrExample<T>()))
2496 Moose::internal::getNullptrExample<T>()))
2497 return "numeric vector value (enclosed in curly braces)";
2500 mooseAssert(
false,
"We control instantiations of this method");
2505 return MooseUtils::trim(doc_string,
". ") +
". A functor is any of the following: a variable, " +
2507 #ifdef MOOSE_MFEM_ENABLED 2513 " 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.