www.mooseframework.org
InputParameters.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
13 #include "MooseUtils.h"
14 #include "MooseError.h"
15 #include "MooseTypes.h"
16 #include "MultiMooseEnum.h"
17 #include "ExecFlagEnum.h"
18 #include "Conversion.h"
19 
20 #include "libmesh/parameters.h"
21 
22 #ifdef LIBMESH_HAVE_FPARSER
23 #include "libmesh/fparser.hh"
24 #else
25 template <typename T>
27 {
28 };
29 #endif
30 
31 #include <tuple>
32 
33 // Forward declarations
34 class Action;
35 class InputParameters;
36 class MooseApp;
37 class MooseEnum;
38 class MooseObject;
39 class MultiMooseEnum;
40 class Problem;
41 
46 template <class T>
48 
53 class InputParameters : public Parameters
54 {
55 public:
56  InputParameters(const InputParameters & rhs);
57  InputParameters(const Parameters & rhs);
58 
59  virtual ~InputParameters() = default;
60 
61  virtual void clear() override;
62 
67  void addClassDescription(const std::string & doc_string);
68 
72  std::string getClassDescription() const;
73 
77  virtual void set_attributes(const std::string & name, bool inserted_only) override;
78 
80  template <typename T>
81  void setHelper(const std::string & name);
82 
98  template <typename T>
99  T & set(const std::string & name, bool quiet_mode = false);
100 
105  template <typename T, typename UP_T>
106  void rangeCheck(const std::string & full_name,
107  const std::string & short_name,
108  InputParameters::Parameter<T> * param,
109  std::ostream & oss = Moose::out);
110  template <typename T, typename UP_T>
111  void rangeCheck(const std::string & full_name,
112  const std::string & short_name,
113  InputParameters::Parameter<std::vector<T>> * param,
114  std::ostream & oss = Moose::out);
115 
120  template <typename T>
121  T getCheckedPointerParam(const std::string & name, const std::string & error_string = "") const;
122 
128  template <typename T>
129  void addRequiredParam(const std::string & name, const std::string & doc_string);
130 
135  template <typename T>
136  void
137  addRequiredParam(const std::string & name, const T & moose_enum, const std::string & doc_string);
138 
140 
146  template <typename T, typename S>
147  void addParam(const std::string & name, const S & value, const std::string & doc_string);
148  template <typename T>
149  void addParam(const std::string & name, const std::string & doc_string);
151 
153  // BEGIN RANGE CHECKED PARAMETER METHODS
158  template <typename T>
159  void addRequiredRangeCheckedParam(const std::string & name,
160  const std::string & parsed_function,
161  const std::string & doc_string);
162  template <typename T>
163  void addRangeCheckedParam(const std::string & name,
164  const T & value,
165  const std::string & parsed_function,
166  const std::string & doc_string);
167  template <typename T>
168  void addRangeCheckedParam(const std::string & name,
169  const std::string & parsed_function,
170  const std::string & doc_string);
171  // END RANGE CHECKED PARAMETER METHODS
173 
179  template <typename T>
180  void addRequiredCustomTypeParam(const std::string & name,
181  const std::string & custom_type,
182  const std::string & doc_string);
183  template <typename T>
184  void addCustomTypeParam(const std::string & name,
185  const T & value,
186  const std::string & custom_type,
187  const std::string & doc_string);
188  template <typename T>
189  void addCustomTypeParam(const std::string & name,
190  const std::string & custom_type,
191  const std::string & doc_string);
192 
199  template <typename T>
200  void addPrivateParam(const std::string & name, const T & value);
201  template <typename T>
202  void addPrivateParam(const std::string & name);
203 
213  template <typename T>
214  void addRequiredCommandLineParam(const std::string & name,
215  const std::string & syntax,
216  const std::string & doc_string);
217  template <typename T>
218  void addCommandLineParam(const std::string & name,
219  const std::string & syntax,
220  const std::string & doc_string);
221  template <typename T>
222  void addCommandLineParam(const std::string & name,
223  const std::string & syntax,
224  const T & value,
225  const std::string & doc_string);
226 
234  template <typename T>
235  void addDeprecatedParam(const std::string & name,
236  const T & value,
237  const std::string & doc_string,
238  const std::string & deprecation_message);
239 
240  template <typename T>
241  void addDeprecatedParam(const std::string & name,
242  const std::string & doc_string,
243  const std::string & deprecation_message);
244 
254  template <typename T>
255  void checkConsistentType(const std::string & name) const;
256 
260  std::vector<std::string> getSyntax(const std::string & name);
261 
265  const std::string & getDescription(const std::string & name);
266 
272  void addParamNamesToGroup(const std::string & space_delim_names, const std::string group_name);
273 
278  std::string getGroupName(const std::string & param_name) const;
279 
286  template <typename T>
287  void suppressParameter(const std::string & name);
288 
293  template <typename T>
294  void makeParamRequired(const std::string & name);
295 
300  template <typename T>
301  void makeParamNotRequired(const std::string & name);
302 
308  void addCoupledVar(const std::string & name, const std::string & doc_string);
309 
318  void addCoupledVar(const std::string & name, const Real value, const std::string & doc_string);
319 
328  void addCoupledVar(const std::string & name,
329  const std::vector<Real> & value,
330  const std::string & doc_string);
331 
333 
350  void addCoupledVarWithAutoBuild(const std::string & name,
351  const std::string & base_name,
352  const std::string & num_name,
353  const std::string & doc_string);
354  void addRequiredCoupledVarWithAutoBuild(const std::string & name,
355  const std::string & base_name,
356  const std::string & num_name,
357  const std::string & doc_string);
359 
365  std::string getMooseType(const std::string & name) const;
366  std::vector<std::string> getVecMooseType(const std::string & name) const;
367 
377  void addRequiredCoupledVar(const std::string & name, const std::string & doc_string);
378 
382  std::string getDocString(const std::string & name) const;
383 
391  void setDocString(const std::string & name, const std::string & doc);
392 
396  bool isParamRequired(const std::string & name) const;
397 
403  bool isParamValid(const std::string & name) const;
404 
410  bool isParamSetByAddParam(const std::string & name) const;
411 
415  bool isParamDeprecated(const std::string & name) const;
416 
421  bool areAllRequiredParamsValid() const;
422 
426  std::string type(const std::string & name);
427 
431  bool isPrivate(const std::string & name) const;
432 
436  void declareControllable(const std::string & name, std::set<ExecFlagType> execute_flags = {});
437 
441  void markControlled(const std::string & name);
442 
446  bool isControllable(const std::string & name);
447 
451  const std::set<ExecFlagType> & getControllableExecuteOnTypes(const std::string & name);
452 
458  void registerBase(const std::string & value);
459 
467  void registerBuildableTypes(const std::string & names);
468 
484  const std::string & name,
486  Moose::RelationshipManagerInputParameterCallback input_parameter_callback = nullptr);
487 
492 
496  const std::vector<std::string> & getBuildableTypes() const;
497 
501  const std::vector<std::tuple<std::string,
505 
507 
511  void collapseSyntaxNesting(bool collapse);
512  bool collapseSyntaxNesting() const;
514 
516 
520  void mooseObjectSyntaxVisibility(bool visibility);
521  bool mooseObjectSyntaxVisibility() const;
523 
525 
528  using Parameters::operator=;
529  using Parameters::operator+=;
533 
540  void checkParams(const std::string & parsing_syntax);
541 
546  inline std::set<std::string>::const_iterator coupledVarsBegin() const
547  {
548  return _coupled_vars.begin();
549  }
550  inline std::set<std::string>::const_iterator coupledVarsEnd() const
551  {
552  return _coupled_vars.end();
553  }
554 
558  const std::set<std::string> & getCoupledVariableParamNames() const { return _coupled_vars; }
559 
565  bool hasCoupledValue(const std::string & coupling_name) const;
566 
572  bool hasDefaultCoupledValue(const std::string & coupling_name) const;
573 
580  Real defaultCoupledValue(const std::string & coupling_name, unsigned int i = 0) const;
581 
587  unsigned int numberDefaultCoupledValues(const std::string & coupling_name) const;
588 
596  void defaultCoupledValue(const std::string & coupling_name, Real value, unsigned int i = 0);
597 
601  std::map<std::string, std::pair<std::string, std::string>> getAutoBuildVectors() const;
602 
610  const PostprocessorValue & getDefaultPostprocessorValue(const std::string & name,
611  bool suppress_error = false,
612  unsigned int index = 0) const;
613 
620  void setDefaultPostprocessorValue(const std::string & name,
621  const PostprocessorValue & value,
622  unsigned int index = 0);
623 
630  bool hasDefaultPostprocessorValue(const std::string & name, unsigned int index = 0) const;
631 
632  // BEGIN APPLY PARAMETER METHODS
650  void applyParameters(const InputParameters & common,
651  std::vector<std::string> exclude = std::vector<std::string>());
652 
670  void applySpecificParameters(const InputParameters & common,
671  const std::vector<std::string> & include,
672  bool allow_private = false);
673 
685  void applyParameter(const InputParameters & common,
686  const std::string & common_name,
687  bool allow_private = false);
688  // END APPLY PARAMETER METHODS
689 
700  void applyCoupledVar(const InputParameters & common, const std::string & var_name);
701 
705  bool paramSetByUser(const std::string & name) const;
706 
711  bool isParamSetByUser(const std::string & name) const;
712 
714  /*
715  * These methods are here to retrieve parameters for scalar and vector types respectively. We will
716  * throw errors
717  * when returning most scalar types, but will allow retrieving empty vectors.
718  */
719  template <typename T>
720  static const T &
721  getParamHelper(const std::string & name, const InputParameters & pars, const T * the_type);
722 
723  template <typename T>
724  static const std::vector<T> & getParamHelper(const std::string & name,
725  const InputParameters & pars,
726  const std::vector<T> * the_type);
728 
732  std::set<std::string> getControllableParameters() const
733  {
734  std::set<std::string> controllable;
735  for (auto it = _params.begin(); it != _params.end(); ++it)
736  if (it->second._controllable)
737  controllable.insert(it->first);
738  return controllable;
739  }
740 
745  void setReservedValues(const std::string & name, const std::set<std::string> & reserved);
746 
751  std::set<std::string> reservedValues(const std::string & name) const;
752 
757  std::string & blockLocation() { return _block_location; };
758 
760 
764  std::string & blockFullpath() { return _block_fullpath; }
765  const std::string & blockFullpath() const { return _block_fullpath; }
767 
769 
773  const std::string & inputLocation(const std::string & param) const
774  {
775  return at(param)._input_location;
776  };
777  std::string & inputLocation(const std::string & param) { return at(param)._input_location; };
779 
781 
785  const std::string & paramFullpath(const std::string & param) const
786  {
787  return at(param)._param_fullpath;
788  };
789  std::string & paramFullpath(const std::string & param) { return at(param)._param_fullpath; };
791 
796  std::string & rawParamVal(const std::string & param) { return _params[param]._raw_val; };
797 
802  template <typename T>
803  void ignoreParameter(const std::string & name);
804 
809  bool shouldIgnore(const std::string & name);
810 
816  bool isSinglePostprocessor(const std::string & pp_name) const
817  {
818  return !_params.find(pp_name)->second._vector_of_postprocessors;
819  }
820 
821 private:
822  // Private constructor so that InputParameters can only be created in certain places.
823  InputParameters();
824 
825  struct Metadata
826  {
827  std::string _doc_string;
829  std::string _custom_type;
830  std::vector<std::string> _cli_flag_names;
832  std::string _group;
834  std::string _range_function;
836  std::pair<std::string, std::string> _autobuild_vecs;
838  bool _required = false;
844  bool _valid = false;
846  bool _is_private = false;
847  bool _have_coupled_default = false;
849  std::vector<Real> _coupled_default = {0};
852  std::vector<bool> _have_default_postprocessor_val = {false};
853  std::vector<PostprocessorValue> _default_postprocessor_val = {0};
855  bool _set_by_add_param = false;
857  std::set<std::string> _reserved_values;
859  std::string _deprecation_message;
861  std::string _input_location;
863  std::string _param_fullpath;
865  std::string _raw_val;
867  bool _controllable = false;
869  std::set<ExecFlagType> _controllable_flags;
871  bool _ignore = false;
872  };
873 
874  Metadata & at(const std::string & param)
875  {
876  if (_params.count(param) == 0)
877  mooseError("param '", param, "' not present in InputParams");
878  return _params[param];
879  }
880  const Metadata & at(const std::string & param) const
881  {
882  if (_params.count(param) == 0)
883  mooseError("param '", param, "' not present in InputParams");
884  return _params.at(param);
885  }
886 
896  void allowCopy(bool status) { _allow_copy = status; }
897 
901  void checkParamName(const std::string & name) const;
902 
907  template <typename T, typename S>
908  void setParamHelper(const std::string & name, T & l_value, const S & r_value);
909 
915  void reserveDefaultPostprocessorValueStorage(const std::string & name, unsigned int size);
916 
923  void setVectorOfPostprocessors(const std::string & pp_name, bool b)
924  {
925  _params[pp_name]._vector_of_postprocessors = b;
926  }
927 
929  std::string _block_location;
930 
932  std::string _block_fullpath;
933 
936  std::map<std::string, Metadata> _params;
937 
939  std::set<std::string> _coupled_vars;
940 
943  std::string _class_description;
944 
947  std::vector<std::string> _buildable_types;
948 
953  std::vector<std::tuple<std::string,
957 
961 
964 
968 
971 
972  // These are the only objects allowed to _create_ InputParameters
975  friend class Parser;
976 };
977 
978 template <typename T>
979 void
980 InputParameters::setHelper(const std::string & /*name*/)
981 {
982 }
983 
984 // Template and inline function implementations
985 template <typename T>
986 T &
987 InputParameters::set(const std::string & name, bool quiet_mode)
988 {
989  checkParamName(name);
990  checkConsistentType<T>(name);
991 
992  if (!this->have_parameter<T>(name))
993  _values[name] = new Parameter<T>;
994 
995  set_attributes(name, false);
996 
997  if (quiet_mode)
998  _params[name]._set_by_add_param = true;
999 
1000  setHelper<T>(name);
1001 
1002  return cast_ptr<Parameter<T> *>(_values[name])->set();
1003 }
1004 
1005 template <typename T, typename UP_T>
1006 void
1007 InputParameters::rangeCheck(const std::string & full_name,
1008  const std::string & short_name,
1009  InputParameters::Parameter<std::vector<T>> * param,
1010  std::ostream & oss)
1011 {
1012  mooseAssert(param, "Parameter is NULL");
1013 
1014  if (!isParamValid(short_name) || _params[short_name]._range_function.empty())
1015  return;
1016 
1029  std::vector<std::string> vars;
1030  if (fp.ParseAndDeduceVariables(_params[short_name]._range_function, vars) != -1) // -1 for success
1031  {
1032  oss << "Error parsing expression: " << _params[short_name]._range_function << '\n';
1033  return;
1034  }
1035 
1036  // Fparser parameter buffer
1037  std::vector<UP_T> parbuf(vars.size());
1038 
1039  // parameter vector
1040  const std::vector<T> & value = param->set();
1041 
1042  // iterate over all vector values (maybe ;)
1043  bool need_to_iterate = false;
1044  unsigned int i = 0;
1045  do
1046  {
1047  // set parameters
1048  for (unsigned int j = 0; j < vars.size(); j++)
1049  {
1050  if (vars[j] == short_name)
1051  {
1052  if (value.size() == 0)
1053  {
1054  oss << "Range checking empty vector: " << _params[short_name]._range_function << '\n';
1055  return;
1056  }
1057 
1058  parbuf[j] = value[i];
1059  need_to_iterate = true;
1060  }
1061  else if (vars[j] == short_name + "_size")
1062  parbuf[j] = value.size();
1063  else
1064  {
1065  if (vars[j].substr(0, short_name.size() + 1) != short_name + "_")
1066  {
1067  oss << "Error parsing expression: " << _params[short_name]._range_function << '\n';
1068  return;
1069  }
1070  std::istringstream iss(vars[j]);
1071  iss.seekg(short_name.size() + 1);
1072 
1073  size_t index;
1074  if (iss >> index && iss.eof())
1075  {
1076  if (index >= value.size())
1077  {
1078  oss << "Error parsing expression: " << _params[short_name]._range_function
1079  << "\nOut of range variable " << vars[j] << '\n';
1080  return;
1081  }
1082  parbuf[j] = value[index];
1083  }
1084  else
1085  {
1086  oss << "Error parsing expression: " << _params[short_name]._range_function
1087  << "\nInvalid variable " << vars[j] << '\n';
1088  return;
1089  }
1090  }
1091  }
1092 
1093  // ensure range-checked input file parameter comparison functions
1094  // do absolute floating point comparisons instead of using a default epsilon.
1095  auto tmp_eps = fp.epsilon();
1096  fp.setEpsilon(0);
1097  UP_T result = fp.Eval(&parbuf[0]);
1098  fp.setEpsilon(tmp_eps);
1099 
1100  // test function using the parameters determined above
1101  if (fp.EvalError())
1102  {
1103  oss << "Error evaluating expression: " << _params[short_name]._range_function << '\n';
1104  return;
1105  }
1106 
1107  if (!result)
1108  {
1109  oss << "Range check failed for parameter " << full_name
1110  << "\n\tExpression: " << _params[short_name]._range_function << "\n";
1111  if (need_to_iterate)
1112  oss << "\t Component: " << i << '\n';
1113  }
1114 
1115  } while (need_to_iterate && ++i < value.size());
1116 }
1117 
1118 template <typename T, typename UP_T>
1119 void
1120 InputParameters::rangeCheck(const std::string & full_name,
1121  const std::string & short_name,
1122  InputParameters::Parameter<T> * param,
1123  std::ostream & oss)
1124 {
1125  mooseAssert(param, "Parameter is NULL");
1126 
1127  if (!isParamValid(short_name) || _params[short_name]._range_function.empty())
1128  return;
1129 
1130  // Parse the expression
1132  if (fp.Parse(_params[short_name]._range_function, short_name) != -1) // -1 for success
1133  {
1134  oss << "Error parsing expression: " << _params[short_name]._range_function << '\n';
1135  return;
1136  }
1137 
1138  // ensure range-checked input file parameter comparison functions
1139  // do absolute floating point comparisons instead of using a default epsilon.
1140  auto tmp_eps = fp.epsilon();
1141  fp.setEpsilon(0);
1142  // We require a non-const value for the implicit upscaling of the parameter type
1143  std::vector<UP_T> value(1, param->set());
1144  UP_T result = fp.Eval(&value[0]);
1145  fp.setEpsilon(tmp_eps);
1146 
1147  if (fp.EvalError())
1148  {
1149  oss << "Error evaluating expression: " << _params[short_name]._range_function
1150  << "\nPerhaps you used the wrong variable name?\n";
1151  return;
1152  }
1153 
1154  if (!result)
1155  oss << "Range check failed for parameter " << full_name
1156  << "\n\tExpression: " << _params[short_name]._range_function << "\n\tValue: " << value[0]
1157  << '\n';
1158 }
1159 
1160 template <typename T>
1161 T
1163  const std::string & error_string) const
1164 {
1165  T param = this->get<T>(name);
1166 
1167  // Note: You will receive a compile error on this line if you attempt to pass a non-pointer
1168  // template type to this method
1169  if (param == NULL)
1170  mooseError("Parameter ", name, " is NULL.\n", error_string);
1171  return this->get<T>(name);
1172 }
1173 
1174 template <typename T>
1175 void
1176 InputParameters::addRequiredParam(const std::string & name, const std::string & doc_string)
1177 {
1178  checkParamName(name);
1179  checkConsistentType<T>(name);
1180 
1181  InputParameters::insert<T>(name);
1182  _params[name]._required = true;
1183  _params[name]._doc_string = doc_string;
1184 }
1185 
1186 template <typename T>
1187 void
1188 InputParameters::addRequiredParam(const std::string & /*name*/,
1189  const T & /*value*/,
1190  const std::string & /*doc_string*/)
1191 {
1192  mooseError("You cannot call addRequiredParam and supply a default value for this type, please "
1193  "use addParam instead");
1194 }
1195 
1196 template <typename T, typename S>
1197 void
1198 InputParameters::addParam(const std::string & name, const S & value, const std::string & doc_string)
1199 {
1200  checkParamName(name);
1201  checkConsistentType<T>(name);
1202 
1203  T & l_value = InputParameters::set<T>(name);
1204  _params[name]._doc_string = doc_string;
1205 
1206  // Set the parameter now
1207  setParamHelper(name, l_value, value);
1208 
1209  /* Indicate the default value, as set via addParam, is being used. The parameter is removed from
1210  the list whenever
1211  it changes, see set_attributes */
1212  _params[name]._set_by_add_param = true;
1213 }
1214 
1215 template <typename T>
1216 void
1217 InputParameters::addParam(const std::string & name, const std::string & doc_string)
1218 {
1219  checkParamName(name);
1220  checkConsistentType<T>(name);
1221 
1222  InputParameters::insert<T>(name);
1223  _params[name]._doc_string = doc_string;
1224 }
1225 
1226 template <typename T, typename S>
1227 void
1228 InputParameters::setParamHelper(const std::string & /*name*/, T & l_value, const S & r_value)
1229 {
1230  l_value = r_value;
1231 }
1232 
1233 template <typename T>
1234 void
1236  const std::string & parsed_function,
1237  const std::string & doc_string)
1238 {
1239  addRequiredParam<T>(name, doc_string);
1240  _params[name]._range_function = parsed_function;
1241 }
1242 
1243 template <typename T>
1244 void
1245 InputParameters::addRangeCheckedParam(const std::string & name,
1246  const T & value,
1247  const std::string & parsed_function,
1248  const std::string & doc_string)
1249 {
1250  addParam<T>(name, value, doc_string);
1251  _params[name]._range_function = parsed_function;
1252 }
1253 
1254 template <typename T>
1255 void
1256 InputParameters::addRangeCheckedParam(const std::string & name,
1257  const std::string & parsed_function,
1258  const std::string & doc_string)
1259 {
1260  addParam<T>(name, doc_string);
1261  _params[name]._range_function = parsed_function;
1262 }
1263 
1264 template <typename T>
1265 void
1267  const std::string & custom_type,
1268  const std::string & doc_string)
1269 {
1270  addRequiredParam<T>(name, doc_string);
1271  _params[name]._custom_type = custom_type;
1272 }
1273 
1274 template <typename T>
1275 void
1276 InputParameters::addCustomTypeParam(const std::string & name,
1277  const T & value,
1278  const std::string & custom_type,
1279  const std::string & doc_string)
1280 {
1281  addParam<T>(name, value, doc_string);
1282  _params[name]._custom_type = custom_type;
1283 }
1284 
1285 template <typename T>
1286 void
1287 InputParameters::addCustomTypeParam(const std::string & name,
1288  const std::string & custom_type,
1289  const std::string & doc_string)
1290 {
1291  addParam<T>(name, doc_string);
1292  _params[name]._custom_type = custom_type;
1293 }
1294 
1295 template <typename T>
1296 void
1297 InputParameters::addPrivateParam(const std::string & name)
1298 {
1299  checkParamName(name);
1300  checkConsistentType<T>(name);
1301 
1302  InputParameters::insert<T>(name);
1303  _params[name]._is_private = true;
1304 }
1305 
1306 template <typename T>
1307 void
1308 InputParameters::addPrivateParam(const std::string & name, const T & value)
1309 {
1310  checkParamName(name);
1311  checkConsistentType<T>(name);
1312 
1313  InputParameters::set<T>(name) = value;
1314  _params[name]._is_private = true;
1315  _params[name]._set_by_add_param = true;
1316 }
1317 
1318 template <typename T>
1319 void
1321  const std::string & syntax,
1322  const std::string & doc_string)
1323 {
1324  addRequiredParam<T>(name, doc_string);
1325  MooseUtils::tokenize(syntax, _params[name]._cli_flag_names, 1, " \t\n\v\f\r");
1326 }
1327 
1328 template <typename T>
1329 void
1330 InputParameters::addCommandLineParam(const std::string & name,
1331  const std::string & syntax,
1332  const std::string & doc_string)
1333 {
1334  addParam<T>(name, doc_string);
1335  MooseUtils::tokenize(syntax, _params[name]._cli_flag_names, 1, " \t\n\v\f\r");
1336 }
1337 
1338 template <typename T>
1339 void
1340 InputParameters::addCommandLineParam(const std::string & name,
1341  const std::string & syntax,
1342  const T & value,
1343  const std::string & doc_string)
1344 {
1345  addParam<T>(name, value, doc_string);
1346  MooseUtils::tokenize(syntax, _params[name]._cli_flag_names, 1, " \t\n\v\f\r");
1347 }
1348 
1349 template <typename T>
1350 void
1351 InputParameters::checkConsistentType(const std::string & name) const
1352 {
1353  // Do we have a paremeter with the same name but a different type?
1354  InputParameters::const_iterator it = _values.find(name);
1355  if (it != _values.end() && dynamic_cast<const Parameter<T> *>(it->second) == NULL)
1356  mooseError("Attempting to set parameter \"",
1357  name,
1358  "\" with type (",
1359  demangle(typeid(T).name()),
1360  ")\nbut the parameter already exists as type (",
1361  it->second->type(),
1362  ")");
1363 }
1364 
1365 template <typename T>
1366 void
1367 InputParameters::suppressParameter(const std::string & name)
1368 {
1369  if (!this->have_parameter<T>(name))
1370  mooseError("Unable to suppress nonexistent parameter: ", name);
1371 
1372  _params[name]._required = false;
1373  _params[name]._is_private = true;
1374 }
1375 
1376 template <typename T>
1377 void
1378 InputParameters::ignoreParameter(const std::string & name)
1379 {
1380  suppressParameter<T>(name);
1381  _params[name]._ignore = true;
1382 }
1383 
1384 template <typename T>
1385 void
1386 InputParameters::makeParamRequired(const std::string & name)
1387 {
1388  if (!this->have_parameter<T>(name))
1389  mooseError("Unable to require nonexistent parameter: ", name);
1390 
1391  _params[name]._required = true;
1392 }
1393 
1394 template <typename T>
1395 void
1396 InputParameters::makeParamNotRequired(const std::string & name)
1397 {
1398  if (!this->have_parameter<T>(name))
1399  mooseError("Unable to un-require nonexistent parameter: ", name);
1400 
1401  _params[name]._required = false;
1402 }
1403 
1404 template <typename T>
1405 void
1406 InputParameters::addDeprecatedParam(const std::string & name,
1407  const T & value,
1408  const std::string & doc_string,
1409  const std::string & deprecation_message)
1410 {
1411  _show_deprecated_message = false;
1412  addParam<T>(name, value, doc_string);
1413 
1414  _params[name]._deprecation_message = deprecation_message;
1415  _show_deprecated_message = true;
1416 }
1417 
1418 template <typename T>
1419 void
1420 InputParameters::addDeprecatedParam(const std::string & name,
1421  const std::string & doc_string,
1422  const std::string & deprecation_message)
1423 {
1424  _show_deprecated_message = false;
1425  addParam<T>(name, doc_string);
1426 
1427  _params[name]._deprecation_message = deprecation_message;
1428  _show_deprecated_message = true;
1429 }
1430 
1431 // Forward declare MooseEnum specializations for add*Param
1432 template <>
1433 void InputParameters::addRequiredParam<MooseEnum>(const std::string & name,
1434  const MooseEnum & moose_enum,
1435  const std::string & doc_string);
1436 
1437 template <>
1438 void InputParameters::addRequiredParam<MultiMooseEnum>(const std::string & name,
1439  const MultiMooseEnum & moose_enum,
1440  const std::string & doc_string);
1441 
1442 template <>
1443 void InputParameters::addRequiredParam<std::vector<MooseEnum>>(
1444  const std::string & name,
1445  const std::vector<MooseEnum> & moose_enums,
1446  const std::string & doc_string);
1447 
1448 template <>
1449 void InputParameters::addParam<MooseEnum>(const std::string & /*name*/,
1450  const std::string & /*doc_string*/);
1451 
1452 template <>
1453 void InputParameters::addParam<MultiMooseEnum>(const std::string & /*name*/,
1454  const std::string & /*doc_string*/);
1455 
1456 template <>
1457 void InputParameters::addParam<std::vector<MooseEnum>>(const std::string & /*name*/,
1458  const std::string & /*doc_string*/);
1459 
1460 template <>
1461 void InputParameters::addPrivateParam<MooseEnum>(const std::string & /*name*/);
1462 
1463 template <>
1464 void InputParameters::addPrivateParam<MultiMooseEnum>(const std::string & /*name*/);
1465 
1466 template <>
1467 void InputParameters::addDeprecatedParam<MooseEnum>(const std::string & name,
1468  const std::string & doc_string,
1469  const std::string & deprecation_message);
1470 
1471 template <>
1472 void InputParameters::addDeprecatedParam<MultiMooseEnum>(const std::string & name,
1473  const std::string & doc_string,
1474  const std::string & deprecation_message);
1475 
1476 template <>
1477 void InputParameters::addDeprecatedParam<std::vector<MooseEnum>>(
1478  const std::string & name,
1479  const std::string & doc_string,
1480  const std::string & deprecation_message);
1481 
1482 // Forward declare specializations for setParamHelper
1483 template <>
1484 void InputParameters::setParamHelper<PostprocessorName, Real>(const std::string & name,
1485  PostprocessorName & l_value,
1486  const Real & r_value);
1487 
1488 template <>
1489 void InputParameters::setParamHelper<PostprocessorName, int>(const std::string & name,
1490  PostprocessorName & l_value,
1491  const int & r_value);
1492 
1493 template <>
1494 void InputParameters::setParamHelper<FunctionName, Real>(const std::string & /*name*/,
1495  FunctionName & l_value,
1496  const Real & r_value);
1497 
1498 template <>
1499 void InputParameters::setParamHelper<FunctionName, int>(const std::string & /*name*/,
1500  FunctionName & l_value,
1501  const int & r_value);
1502 
1503 template <>
1504 void InputParameters::setParamHelper<MaterialPropertyName, Real>(const std::string & /*name*/,
1505  MaterialPropertyName & l_value,
1506  const Real & r_value);
1507 
1508 template <>
1509 void InputParameters::setParamHelper<MaterialPropertyName, int>(const std::string & /*name*/,
1510  MaterialPropertyName & l_value,
1511  const int & r_value);
1512 template <>
1513 void InputParameters::setHelper<std::vector<PostprocessorName>>(const std::string & name);
1514 
1515 template <typename T>
1516 const T &
1517 InputParameters::getParamHelper(const std::string & name, const InputParameters & pars, const T *)
1518 {
1519  if (!pars.isParamValid(name))
1520  mooseError("The parameter \"", name, "\" is being retrieved before being set.\n");
1521 
1522  return pars.get<T>(name);
1523 }
1524 
1525 // Declare specializations so we don't fall back on the generic
1526 // implementation, but the definition will be in InputParameters.C so
1527 // we won't need to bring in *MooseEnum header files here.
1528 template <>
1529 const MooseEnum & InputParameters::getParamHelper<MooseEnum>(const std::string & name,
1530  const InputParameters & pars,
1531  const MooseEnum *);
1532 
1533 template <>
1534 const MultiMooseEnum & InputParameters::getParamHelper<MultiMooseEnum>(const std::string & name,
1535  const InputParameters & pars,
1536  const MultiMooseEnum *);
1537 
1538 template <typename T>
1539 const std::vector<T> &
1540 InputParameters::getParamHelper(const std::string & name,
1541  const InputParameters & pars,
1542  const std::vector<T> *)
1543 {
1544  return pars.get<std::vector<T>>(name);
1545 }
1546 
1548 
1549 template <class T>
1552 {
1553  // If users forgot to make their (old) validParams, they screwed up and
1554  // should get an error - so it is okay for us to try to call the new
1555  // validParams static function - which will error if they didn't implement
1556  // the new function. We can't have the old static assert that use to be
1557  // here because then the sfinae for toggling between old and new-style
1558  // templating will always see this function and call it even if an object
1559  // has *only* the new style validParams.
1560  return T::validParams();
1561 }
InputParameters::getParamHelper
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
Definition: InputParameters.h:1517
InputParameters::getVecMooseType
std::vector< std::string > getVecMooseType(const std::string &name) const
Definition: InputParameters.C:556
InputParameters::isParamSetByUser
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
Definition: InputParameters.C:837
InputParameters::getSyntax
std::vector< std::string > getSyntax(const std::string &name)
Get the syntax for a command-line parameter.
Definition: InputParameters.C:614
InputParameters::Metadata::_have_default_postprocessor_val
std::vector< bool > _have_default_postprocessor_val
Definition: InputParameters.h:852
InputParameters::addRequiredCoupledVar
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
Definition: InputParameters.C:216
InputParameters::makeParamRequired
void makeParamRequired(const std::string &name)
Changes the parameter to be required.
Definition: InputParameters.h:1386
InputParameters::Metadata::_ignore
bool _ignore
whether user setting of this parameter should be ignored
Definition: InputParameters.h:871
InputParameters::_buildable_rm_types
std::vector< std::tuple< std::string, Moose::RelationshipManagerType, Moose::RelationshipManagerInputParameterCallback > > _buildable_rm_types
The RelationshipManagers that this object may either build or require.
Definition: InputParameters.h:956
InputParameters::declareControllable
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
Definition: InputParameters.C:297
InputParameters::getControllableExecuteOnTypes
const std::set< ExecFlagType > & getControllableExecuteOnTypes(const std::string &name)
Return the allowed execute flags for a controllable parameter.
Definition: InputParameters.C:324
InputParameters::getCoupledVariableParamNames
const std::set< std::string > & getCoupledVariableParamNames() const
Return the coupled variable parameter names.
Definition: InputParameters.h:558
InputParameters::getBuildableRelationshipManagerTypes
const std::vector< std::tuple< std::string, Moose::RelationshipManagerType, Moose::RelationshipManagerInputParameterCallback > > & getBuildableRelationshipManagerTypes() const
Returns the list of buildable (or required) RelationshipManager object types for this object.
Definition: InputParameters.C:361
InputParameters::registerBuildableTypes
void registerBuildableTypes(const std::string &names)
This method is here to indicate which Moose types a particular Action may build.
Definition: InputParameters.C:337
InputParameters::_allow_copy
bool _allow_copy
A flag for toggling the error message in the copy constructor.
Definition: InputParameters.h:970
InputParameters::setHelper
void setHelper(const std::string &name)
This functions is called in set as a 'callback' to avoid code duplication.
Definition: InputParameters.h:980
InputParameters::Metadata::_deprecation_message
std::string _deprecation_message
If non-empty, this parameter is deprecated.
Definition: InputParameters.h:859
InputParameters::_class_description
std::string _class_description
The class description for the owning object.
Definition: InputParameters.h:943
InputParameters::hasDefaultPostprocessorValue
bool hasDefaultPostprocessorValue(const std::string &name, unsigned int index=0) const
Returns true if a default PostprocessorValue is defined.
Definition: InputParameters.C:683
InputParameters::coupledVarsEnd
std::set< std::string >::const_iterator coupledVarsEnd() const
Definition: InputParameters.h:550
InputParameters::collapseSyntaxNesting
bool collapseSyntaxNesting() const
Definition: InputParameters.C:373
InputParameters::Metadata::_range_function
std::string _range_function
The map of functions used for range checked parameters.
Definition: InputParameters.h:834
InputParameters::Metadata::_required
bool _required
True for parameters that are required (i.e. will cause an abort if not supplied)
Definition: InputParameters.h:838
InputParameters::defaultCoupledValue
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
Definition: InputParameters.C:479
InputParameters::InputParameters
InputParameters()
Definition: InputParameters.C:30
InputParameters::isControllable
bool isControllable(const std::string &name)
Returns a Boolean indicating whether the specified parameter is controllable.
Definition: InputParameters.C:318
InputParameters::Metadata::_valid
bool _valid
Whether the parameter is either explicitly set or provided a default value when added Note: We do not...
Definition: InputParameters.h:844
InputParameters::addRelationshipManager
void addRelationshipManager(const std::string &name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback input_parameter_callback=nullptr)
Tells MOOSE about a RelationshipManager that this object needs.
Definition: InputParameters.C:344
InputParameters::Metadata::_custom_type
std::string _custom_type
The custom type that will be printed in the YAML dump for a parameter if supplied.
Definition: InputParameters.h:829
ExecFlagEnum.h
InputParameters::setDocString
void setDocString(const std::string &name, const std::string &doc)
Set the doc string of a parameter.
Definition: InputParameters.C:240
InputParameters::isSinglePostprocessor
bool isSinglePostprocessor(const std::string &pp_name) const
Getter for the _vector_of_postprocessors flag in parameters.
Definition: InputParameters.h:816
InputParameters::applyCoupledVar
void applyCoupledVar(const InputParameters &common, const std::string &var_name)
Apply properties of a single coupled variable in common, to a single coupled variable stored in this ...
Definition: InputParameters.C:764
InputParameters::Metadata
Definition: InputParameters.h:825
InputParameters::getDescription
const std::string & getDescription(const std::string &name)
Get the documentation string for a parameter.
Definition: InputParameters.C:848
MooseEnum
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
InputParameters::getMooseType
std::string getMooseType(const std::string &name) const
Utility functions for retrieving one of the MooseTypes variables into the common "string" base class.
Definition: InputParameters.C:529
Moose::execute_flags
ExecFlagEnum execute_flags
Storage for the registered execute flags.
InputParameters::addRequiredCoupledVarWithAutoBuild
void addRequiredCoupledVarWithAutoBuild(const std::string &name, const std::string &base_name, const std::string &num_name, const std::string &doc_string)
Definition: InputParameters.C:205
emptyInputParameters
InputParameters emptyInputParameters()
Definition: InputParameters.C:24
InputParameters::clear
virtual void clear() override
Definition: InputParameters.C:56
InputParameters::operator+=
InputParameters & operator+=(const InputParameters &rhs)
Definition: InputParameters.C:142
InputParameters::setVectorOfPostprocessors
void setVectorOfPostprocessors(const std::string &pp_name, bool b)
Setter for the _vector_of_postprocessors flag in parameters.
Definition: InputParameters.h:923
InputParameters::reservedValues
std::set< std::string > reservedValues(const std::string &name) const
Get a set of reserved parameter values.
Definition: InputParameters.C:1085
InputParameters::getClassDescription
std::string getClassDescription() const
Returns the class description.
Definition: InputParameters.C:102
InputParameters::addParam
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object.
Definition: InputParameters.h:1198
InputParameters::allowCopy
void allowCopy(bool status)
Toggle the availability of the copy constructor.
Definition: InputParameters.h:896
InputParameters::paramSetByUser
bool paramSetByUser(const std::string &name) const
Deprecated method.
Definition: InputParameters.C:830
Moose::RelationshipManagerInputParameterCallback
std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
The type for the callback to set RelationshipManager parameters.
Definition: MooseTypes.h:871
InputParameters::rawParamVal
std::string & rawParamVal(const std::string &param)
Get/set a string representing the raw, unmodified token text for the given param.
Definition: InputParameters.h:796
MultiMooseEnum.h
InputParameters::ignoreParameter
void ignoreParameter(const std::string &name)
Informs this object that values for this parameter set from the input file or from the command line s...
Definition: InputParameters.h:1378
InputParameters::_block_fullpath
std::string _block_fullpath
full HIT path of the block from the input file - used for nice error messages.
Definition: InputParameters.h:932
InputParameters::_buildable_types
std::vector< std::string > _buildable_types
The parameter is used to restrict types that can be built.
Definition: InputParameters.h:947
InputParameters::Metadata::_doc_string
std::string _doc_string
Definition: InputParameters.h:827
Action
Base class for actions.
Definition: Action.h:39
InputParameters::emptyInputParameters
friend InputParameters emptyInputParameters()
Definition: InputParameters.C:24
InputParameters::paramFullpath
const std::string & paramFullpath(const std::string &param) const
Get/set a string representing the full HIT parameter path from the input file (e.g.
Definition: InputParameters.h:785
InputParameters::paramFullpath
std::string & paramFullpath(const std::string &param)
Definition: InputParameters.h:789
InputParameters::blockLocation
std::string & blockLocation()
Get/set a string representing the location (i.e.
Definition: InputParameters.h:757
InputParameters::addCustomTypeParam
void addCustomTypeParam(const std::string &name, const T &value, const std::string &custom_type, const std::string &doc_string)
Definition: InputParameters.h:1276
InputParameters::addRequiredCommandLineParam
void addRequiredCommandLineParam(const std::string &name, const std::string &syntax, const std::string &doc_string)
Add parameters for retrieval from the command line.
Definition: InputParameters.h:1320
InputParameters::Metadata::_input_location
std::string _input_location
original location of parameter (i.e. filename,linenum) - used for nice error messages.
Definition: InputParameters.h:861
InputParameters::registerBase
void registerBase(const std::string &value)
This method must be called from every base "Moose System" to create linkage with the Action System.
Definition: InputParameters.C:330
InputParameters::applyParameter
void applyParameter(const InputParameters &common, const std::string &common_name, bool allow_private=false)
Apply values from a single parameter in common, to a single parameter stored in this object.
Definition: InputParameters.C:791
InputParameters::clearRelationshipManagers
void clearRelationshipManagers()
Clears all currently registered RelationshipManagers.
Definition: InputParameters.h:491
InputParameters::Metadata::_param_fullpath
std::string _param_fullpath
full HIT path of the parameter from the input file - used for nice error messages.
Definition: InputParameters.h:863
mooseError
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition: MooseError.h:210
MooseObject
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:50
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition: InputParameters.h:53
MooseUtils::tokenize
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 ...
Definition: MooseUtils.h:535
InputParameters::isParamDeprecated
bool isParamDeprecated(const std::string &name) const
Returns True if the parameters is deprecated.
Definition: InputParameters.C:276
InputParameters::set
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Definition: InputParameters.h:987
InputParameters::inputLocation
const std::string & inputLocation(const std::string &param) const
Get/set a string representing the location in the input text the parameter originated from (i....
Definition: InputParameters.h:773
InputParameters::at
const Metadata & at(const std::string &param) const
Definition: InputParameters.h:880
InputParameters::reserveDefaultPostprocessorValueStorage
void reserveDefaultPostprocessorValueStorage(const std::string &name, unsigned int size)
Reserve space for default postprocessor values.
Definition: InputParameters.C:652
InputParameters::hasCoupledValue
bool hasCoupledValue(const std::string &coupling_name) const
Return whether or not the coupled variable exists.
Definition: InputParameters.C:458
PostprocessorValue
Real PostprocessorValue
MOOSE typedefs.
Definition: MooseTypes.h:189
InputParameters::addCommandLineParam
void addCommandLineParam(const std::string &name, const std::string &syntax, const std::string &doc_string)
Definition: InputParameters.h:1330
InputParameters::setReservedValues
void setReservedValues(const std::string &name, const std::set< std::string > &reserved)
Provide a set of reserved values for a parameter.
Definition: InputParameters.C:1079
InputParameters::addRequiredCustomTypeParam
void addRequiredCustomTypeParam(const std::string &name, const std::string &custom_type, const std::string &doc_string)
These methods add an option parameter and with a customer type to the InputParameters object.
Definition: InputParameters.h:1266
InputParameters::_params
std::map< std::string, Metadata > _params
The actual parameter data.
Definition: InputParameters.h:936
InputParameters::getControllableParameters
std::set< std::string > getControllableParameters() const
Return list of controllable parameters.
Definition: InputParameters.h:732
InputParameters::numberDefaultCoupledValues
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
Definition: InputParameters.C:496
InputParameters::Metadata::_reserved_values
std::set< std::string > _reserved_values
The reserved option names for a parameter.
Definition: InputParameters.h:857
InputParameters::checkParamName
void checkParamName(const std::string &name) const
Make sure the parameter name doesn't have any invalid characters.
Definition: InputParameters.C:1094
InputParameters::areAllRequiredParamsValid
bool areAllRequiredParamsValid() const
This method returns true if all of the parameters in this object are valid (i.e.
Definition: InputParameters.C:282
InputParameters::coupledVarsBegin
std::set< std::string >::const_iterator coupledVarsBegin() const
Methods returning iterators to the coupled variables names stored in this InputParameters object.
Definition: InputParameters.h:546
InputParameters::Metadata::_vector_of_postprocessors
bool _vector_of_postprocessors
are pps provided as single pp or as vector of pps
Definition: InputParameters.h:851
InputParameters::_moose_object_syntax_visibility
bool _moose_object_syntax_visibility
This parameter hides derived MOOSE object types from appearing in syntax dumps.
Definition: InputParameters.h:963
InputParameters::isPrivate
bool isPrivate(const std::string &name) const
Returns a Boolean indicating whether the specified parameter is private or not.
Definition: InputParameters.C:291
InputParameters::setParamHelper
void setParamHelper(const std::string &name, T &l_value, const S &r_value)
This method is called when adding a Parameter with a default value, can be specialized for non-matchi...
Definition: InputParameters.h:1228
InputParameters::addDeprecatedParam
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
Definition: InputParameters.h:1406
Problem
Class that hold the whole problem being solved.
Definition: Problem.h:24
InputParameters::inputLocation
std::string & inputLocation(const std::string &param)
Definition: InputParameters.h:777
InputParameters::blockFullpath
const std::string & blockFullpath() const
Definition: InputParameters.h:765
InputParameters::isParamValid
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another,...
Definition: InputParameters.C:257
Moose::RelationshipManagerType
RelationshipManagerType
Main types of Relationship Managers.
Definition: MooseTypes.h:852
InputParameters::Metadata::_default_postprocessor_val
std::vector< PostprocessorValue > _default_postprocessor_val
Definition: InputParameters.h:853
InputParameters::_block_location
std::string _block_location
original location of input block (i.e. filename,linenum) - used for nice error messages.
Definition: InputParameters.h:929
InputParameters::addClassDescription
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Definition: InputParameters.C:70
InputParameters::shouldIgnore
bool shouldIgnore(const std::string &name)
Whether to ignore the value of an input parameter set in the input file or from the command line.
Definition: InputParameters.C:1102
InputParameters::Metadata::_set_by_add_param
bool _set_by_add_param
True if a parameters value was set by addParam, and not set again.
Definition: InputParameters.h:855
InputParameters::addRequiredRangeCheckedParam
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
These methods add an range checked parameters.
Definition: InputParameters.h:1235
InputParameters::getGroupName
std::string getGroupName(const std::string &param_name) const
This method retrieves the group name for the passed parameter name if one exists.
Definition: InputParameters.C:620
validParams
InputParameters validParams()
This is the templated validParams() function that every MooseObject-derived class is required to spec...
Definition: InputParameters.h:1551
InputParameters::Metadata::_autobuild_vecs
std::pair< std::string, std::string > _autobuild_vecs
directions for auto build vectors (base_, 5) -> "base_0 base_1 base_2 base_3 base_4")
Definition: InputParameters.h:836
InputParameters::addRangeCheckedParam
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
Definition: InputParameters.h:1245
InputParameters::Metadata::_group
std::string _group
The names of the parameters organized into groups.
Definition: InputParameters.h:832
InputParameters::mooseObjectSyntaxVisibility
bool mooseObjectSyntaxVisibility() const
Definition: InputParameters.C:385
InputParameters::addCoupledVarWithAutoBuild
void addCoupledVarWithAutoBuild(const std::string &name, const std::string &base_name, const std::string &num_name, const std::string &doc_string)
These methods add a coupled variable name pair.
Definition: InputParameters.C:190
Parser
Class for parsing input files.
Definition: Parser.h:97
InputParameters::suppressParameter
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn't required or valid in the derived class...
Definition: InputParameters.h:1367
Conversion.h
InputParameters::blockFullpath
std::string & blockFullpath()
Get/set a string representing the full HIT parameter path from the input file (e.g.
Definition: InputParameters.h:764
InputParameters::isParamSetByAddParam
bool isParamSetByAddParam(const std::string &name) const
Returns whether or not the parameter was set due to addParam.
Definition: InputParameters.C:270
InputParameters::type
std::string type(const std::string &name)
Prints the type of the requested parameter by name.
Definition: InputParameters.C:519
InputParameters::addCoupledVar
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
Definition: InputParameters.C:183
InputParameters::addParamNamesToGroup
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...
Definition: InputParameters.C:590
InputParameterWarehouse
Storage container for all InputParamter objects.
Definition: InputParameterWarehouse.h:32
InputParameters::getCheckedPointerParam
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller.
Definition: InputParameters.h:1162
MultiMooseEnum
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MultiMooseEnum.h:38
MooseError.h
InputParameters::Metadata::_cli_flag_names
std::vector< std::string > _cli_flag_names
Definition: InputParameters.h:830
InputParameters::getBuildableTypes
const std::vector< std::string > & getBuildableTypes() const
Returns the list of buildable types as a std::vector<std::string>
Definition: InputParameters.C:353
InputParameters::rangeCheck
void rangeCheck(const std::string &full_name, const std::string &short_name, InputParameters::Parameter< T > *param, std::ostream &oss=Moose::out)
Runs a range on the supplied parameter if it exists and throws an error if that check fails.
Definition: InputParameters.h:1120
InputParameters::isParamRequired
bool isParamRequired(const std::string &name) const
Returns a boolean indicating whether the specified parameter is required or not.
Definition: InputParameters.C:251
InputParameters::_collapse_nesting
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.
Definition: InputParameters.h:960
MooseApp
Base class for MOOSE-based applications.
Definition: MooseApp.h:61
InputParameters::getDocString
std::string getDocString(const std::string &name) const
Returns the documentation string for the specified parameter name.
Definition: InputParameters.C:223
InputParameters::Metadata::_raw_val
std::string _raw_val
raw token text for a parameter - usually only set for filepath type params.
Definition: InputParameters.h:865
InputParameters::_show_deprecated_message
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
Definition: InputParameters.h:967
InputParameters::applyParameters
void applyParameters(const InputParameters &common, std::vector< std::string > exclude=std::vector< std::string >())
Method for applying common parameters.
Definition: InputParameters.C:696
InputParameters::checkConsistentType
void checkConsistentType(const std::string &name) const
This method checks to make sure that we aren't adding a parameter with the same name but a different ...
Definition: InputParameters.h:1351
InputParameters::Metadata::_controllable
bool _controllable
True if the parameters is controllable.
Definition: InputParameters.h:867
InputParameters::markControlled
void markControlled(const std::string &name)
Marker a parameter that has been changed by the Control system (this is for output purposes)
InputParameters::Metadata::_is_private
bool _is_private
The set of parameters that will NOT appear in the the dump of the parser tree.
Definition: InputParameters.h:846
InputParameters::makeParamNotRequired
void makeParamNotRequired(const std::string &name)
Changes the parameter to not be required.
Definition: InputParameters.h:1396
InputParameters::getAutoBuildVectors
std::map< std::string, std::pair< std::string, std::string > > getAutoBuildVectors() const
Returns the auto build vectors for all parameters.
Definition: InputParameters.C:507
InputParameters::at
Metadata & at(const std::string &param)
Definition: InputParameters.h:874
InputParameters::getDefaultPostprocessorValue
const PostprocessorValue & getDefaultPostprocessorValue(const std::string &name, bool suppress_error=false, unsigned int index=0) const
Get the default value for a postprocessor added with addPostprocessor.
Definition: InputParameters.C:629
InputParameters::_coupled_vars
std::set< std::string > _coupled_vars
The coupled variables set.
Definition: InputParameters.h:939
InputParameters::Metadata::_have_coupled_default
bool _have_coupled_default
Definition: InputParameters.h:847
InputParameters::hasDefaultCoupledValue
bool hasDefaultCoupledValue(const std::string &coupling_name) const
Return whether or not the requested parameter has a default coupled value.
Definition: InputParameters.C:464
MooseTypes.h
InputParameters::Metadata::_controllable_flags
std::set< ExecFlagType > _controllable_flags
Controllable execute flag restriction.
Definition: InputParameters.h:869
InputParameters::addPrivateParam
void addPrivateParam(const std::string &name, const T &value)
These method add a parameter to the InputParameters object which can be retrieved like any other para...
Definition: InputParameters.h:1308
MooseUtils.h
InputParameters::operator=
InputParameters & operator=(const InputParameters &rhs)
Definition: InputParameters.C:108
InputParameters::applySpecificParameters
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
Method for applying common parameters.
Definition: InputParameters.C:729
InputParameters::checkParams
void checkParams(const std::string &parsing_syntax)
This function checks parameters stored in the object to make sure they are in the correct state as th...
Definition: InputParameters.C:409
InputParameters::addRequiredParam
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
Definition: InputParameters.h:1176
InputParameters::setDefaultPostprocessorValue
void setDefaultPostprocessorValue(const std::string &name, const PostprocessorValue &value, unsigned int index=0)
Set the default value for a postprocessor added with addPostprocessor.
Definition: InputParameters.C:662
InputParameters::set_attributes
virtual void set_attributes(const std::string &name, bool inserted_only) override
Override from libMesh to set user-defined attributes on our parameter.
Definition: InputParameters.C:76
InputParameters::Metadata::_coupled_default
std::vector< Real > _coupled_default
The default value for optionally coupled variables.
Definition: InputParameters.h:849
InputParameters::~InputParameters
virtual ~InputParameters()=default
FunctionParserBase
Definition: InputParameters.h:26