21 #define usingMooseBaseParameterInterfaceMembers \ 22 using MooseBaseParameterInterface::parameters; \ 23 using MooseBaseParameterInterface::uniqueName; \ 24 using MooseBaseParameterInterface::isParamValid; \ 25 using MooseBaseParameterInterface::isParamSetByUser; \ 26 using MooseBaseParameterInterface::paramError; \ 27 using MooseBaseParameterInterface::_pars; \ 28 using MooseBaseParameterInterface::_factory; \ 29 using MooseBaseParameterInterface::_action_factory 78 const T &
getParam(
const std::string & name)
const;
89 const T *
queryParam(
const std::string & name)
const;
99 const T &
getRenamedParam(
const std::string & old_name,
const std::string & new_name)
const;
107 template <
typename T1,
typename T2>
108 std::vector<std::pair<T1, T2>>
getParam(
const std::string & param1,
109 const std::string & param2)
const;
115 template <
typename T>
136 template <
typename... Args>
137 [[noreturn]]
void paramError(
const std::string & param, Args... args)
const;
145 template <
typename... Args>
146 void paramWarning(
const std::string & param, Args... args)
const;
155 template <
typename... Args>
156 void paramInfo(
const std::string & param, Args... args)
const;
167 const std::string & object_type,
168 const std::string & object_name,
169 const std::string & object_parameter)
const;
185 template <
typename... Args>
191 const std::string object_prefix =
194 std::ostringstream oss;
196 std::string msg = oss.str();
202 if ((param_prefix.size() > 12 && msg.size() + param_prefix.size() > 99) ||
203 msg.find(
"\n") != std::string::npos)
205 if (param_prefix.size() > 0 && param_prefix[param_prefix.size() - 1] !=
':')
209 return object_prefix + param_prefix +
" " + msg;
213 template <
typename T>
220 template <
typename T>
227 template <
typename T>
230 const std::string & new_name)
const 245 "' is being retrieved without being set.\n" 246 "Did you misspell it?");
250 "' may not be provided alongside former parameter '" + old_name +
"'");
253 template <
typename... Args>
263 template <
typename... Args>
270 template <
typename... Args>
277 template <
typename T1,
typename T2>
278 std::vector<std::pair<T1, T2>>
281 return _pars.
get<T1, T2>(param1, param2);
284 template <
typename T>
287 const std::string & error_string)
const 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...
Every object that can be built by the factory should be derived from this class.
const MooseBase & _moose_base
The MooseBase object that inherits this class.
Base class for everything in MOOSE with a name and a type.
Generic factory class for build all sorts of objects.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
virtual const std::string & name() const
Get the name of the class.
virtual ~MooseBaseParameterInterface()=default
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Factory & _factory
The Factory associated with the MooseApp.
MooseBaseParameterInterface(const MooseBase &base, const InputParameters ¶meters)
MooseObjectParameterName uniqueParameterName(const std::string ¶meter_name) const
The unique parameter name of a valid parameter of this object for accessing parameter controls...
void mooseInfo(Args &&... args)
Emit an informational message with the given stringified, concatenated args.
MooseObjectName uniqueName() const
The unique name for accessing input parameters of this object in the InputParameterWarehouse.
const T * queryParam(const std::string &name) const
Query a parameter for the object.
std::string errorPrefix(const std::string &error_type) const
Specialized factory for generic Action System objects.
std::string paramErrorMsg(const std::string ¶m, Args... args) const
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
ActionFactory & _action_factory
Builds Actions.
void connectControllableParams(const std::string ¶meter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
Connect controllable parameter of this action with the controllable parameters of the objects added b...
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...
const T & getRenamedParam(const std::string &old_name, const std::string &new_name) const
Retrieve a renamed parameter for the object.
bool isParamSetByUser(const std::string &nm) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
void callMooseError(std::string msg, const bool with_prefix) const
Calls moose error with the message msg.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
const InputParameters & parameters() const
Get the parameters of the object.
A class for storing an input parameter name.
void paramWarning(const std::string ¶m, Args... args) const
Emits a warning prefixed with the file and line number of the given param (from the input file) along...
A class for storing the names of MooseObject by tag and object name.
std::string replaceAll(std::string str, const std::string &from, const std::string &to)
Replaces all occurrences of from in str with to and returns the result.
void paramInfo(const std::string ¶m, Args... args) const
Emits an informational message prefixed with the file and line number of the given param (from the in...
std::string paramErrorPrefix(const InputParameters ¶ms, const std::string ¶m)
Get canonical paramError prefix for param-related error/warning/info messages.