26 #define usingMooseBaseMembers \ 27 using MooseBase::getMooseApp; \ 28 using MooseBase::type; \ 29 using MooseBase::name; \ 30 using MooseBase::typeAndName; \ 31 using MooseBase::uniqueName; \ 32 using MooseBase::parameters; \ 33 using MooseBase::isParamValid; \ 34 using MooseBase::isParamSetByUser; \ 35 using MooseBase::paramError; \ 36 using MooseBase::paramWarning; \ 37 using MooseBase::paramInfo; \ 38 using MooseBase::_app; \ 39 using MooseBase::_type; \ 40 using MooseBase::_name; \ 41 using MooseBase::_pars 62 #ifdef MOOSE_KOKKOS_ENABLED 93 const std::string &
type()
const 95 mooseAssert(
_type.size(),
"Empty type");
103 const std::string &
name()
const 105 mooseAssert(
_name.size(),
"Empty name");
154 template <
typename T>
165 template <
typename T>
175 template <
typename T>
176 const T &
getRenamedParam(
const std::string & old_name,
const std::string & new_name)
const;
184 template <
typename T1,
typename T2>
185 std::vector<std::pair<T1, T2>>
getParam(
const std::string & param1,
186 const std::string & param2)
const;
192 template <
typename T>
199 template <
typename T>
229 const std::string & object_type,
230 const std::string & object_name,
231 const std::string & object_parameter)
const;
239 template <
typename... Args>
240 [[noreturn]]
void paramError(
const std::string & param, Args... args)
const;
248 template <
typename... Args>
249 void paramWarning(
const std::string & param, Args... args)
const;
258 template <
typename... Args>
259 void paramInfo(
const std::string & param, Args... args)
const;
280 template <
typename... Args>
283 callMooseError(argumentsToString(std::forward<Args>(args)...),
true);
286 template <
typename... Args>
288 const unsigned int issue_num,
289 Args &&... args)
const 292 repo_name, issue_num, argumentsToString(std::forward<Args>(args)...)),
299 template <
typename... Args>
302 callMooseError(argumentsToString(std::forward<Args>(args)...),
false);
308 template <
typename... Args>
317 template <
typename... Args>
326 template <
typename... Args>
336 template <
typename... Args>
343 template <
typename... Args>
358 const bool with_prefix,
359 const hit::Node * node =
nullptr,
360 const bool show_trace =
true)
const;
379 const bool with_prefix,
380 const hit::Node * node,
381 const bool show_trace =
true);
414 template <
typename T>
418 return InputParameters::getParamHelper<T>(
name,
_pars);
421 template <
typename T>
428 template <
typename T>
434 return getParam<T>(new_name);
437 return getParam<T>(old_name);
440 return getParam<T>(new_name);
444 "' is being retrieved without being set.\nDid you misspell it?");
447 mooseError(
"Parameter '" + new_name +
"' may not be provided alongside former parameter '" +
451 template <
typename T1,
typename T2>
452 std::vector<std::pair<T1, T2>>
455 return _pars.
get<T1, T2>(param1, param2);
458 template <
typename T>
465 template <
typename... Args>
472 template <
typename... Args>
479 template <
typename... Args>
void mooseInfo(Args &&... args) const
static const std::string name_param
The name of the parameter that contains the object name.
static const std::string app_param
The name of the parameter that contains the MooseApp.
const InputParameters & _pars
The object's parameters.
const std::string & _name
The name of this class.
Base class for everything in MOOSE with a name and a type.
static const std::string type_param
The name of the parameter that contains the object type.
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 ...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
bool haveParameter(const std::string &name) const
Test if a parameter of the given name and type exists.
const InputParameters & parameters() const
Get the parameters of the object.
Base class for MOOSE-based applications.
void mooseDocumentedError(const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
MooseObjectName uniqueName() const
MooseObjectParameterName uniqueParameterName(const std::string ¶meter_name) const
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
static const std::string unique_name_param
The name of the parameter that contains the unique object name.
void mooseInfoStream(S &oss, Args &&... args)
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...
void mooseErrorNonPrefixed(Args &&... args) const
Emits an error without the prefixing included in mooseError().
const std::string & name() const
Get the name of the class.
static const std::string moose_base_param
The name of the parameter that contains the moose system base.
static const std::string kokkos_object_param
The name of the parameter that indicates an object is a Kokkos functor.
void mooseDeprecated(Args &&... args) const
Emits a deprecation warning prefixed with the object name and type, and a stack trace.
void mooseWarningNonPrefixed(Args &&... args) const
Emits a warning without the prefixing included in mooseWarning().
void mooseDeprecatedStream(S &oss, const bool expired, const bool print_title, const bool show_trace, Args &&... args)
An inteface for the _console for outputting to the Console object.
void mooseWarningStream(S &oss, Args &&... args)
const std::string & type() const
Get the type of this class.
std::string typeAndName() const
Get the class's combined type and name; useful in error handling.
MooseApp & _app
The MOOSE application this is associated with.
const T * queryParam(const std::string &name) const
Query a parameter for the object.
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
virtual ~MooseBase()=default
std::string errorPrefix(const std::string &) const
Deprecated message prefix; the error type is no longer used.
void callMooseError(std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
External method for calling moose error with added object context.
A class for storing an input parameter name.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
const std::string & getBase() const
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...
const hit::Node * getHitNode() const
A class for storing the names of MooseObject by tag and object name.
bool isParamSetByUser(const std::string &name) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
const std::string & _type
The type of this class.
std::string formatMooseDocumentedError(const std::string &repo_name, const unsigned int issue_num, const std::string &msg)
Formats a documented error.
static InputParameters validParams()
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...
MooseBase(const InputParameters ¶ms)
Primary constructor for general objects.
const T & getRenamedParam(const std::string &old_name, const std::string &new_name) const
Retrieve a renamed parameter for the object.
std::string messagePrefix(const bool hit_prefix=true) const
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...
void mooseDeprecatedNoTrace(Args &&... args) const
Emits a deprecation warning prefixed with the object name and type, and no stack trace.