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>
219 const std::string & object_type,
220 const std::string & object_name,
221 const std::string & object_parameter)
const;
229 template <
typename... Args>
230 [[noreturn]]
void paramError(
const std::string & param, Args... args)
const;
238 template <
typename... Args>
239 void paramWarning(
const std::string & param, Args... args)
const;
248 template <
typename... Args>
249 void paramInfo(
const std::string & param, Args... args)
const;
270 template <
typename... Args>
273 callMooseError(argumentsToString(std::forward<Args>(args)...),
true);
276 template <
typename... Args>
278 const unsigned int issue_num,
279 Args &&... args)
const 282 repo_name, issue_num, argumentsToString(std::forward<Args>(args)...)),
289 template <
typename... Args>
292 callMooseError(argumentsToString(std::forward<Args>(args)...),
false);
298 template <
typename... Args>
307 template <
typename... Args>
313 template <
typename... Args>
320 template <
typename... Args>
334 callMooseError(std::string msg,
const bool with_prefix,
const hit::Node * node =
nullptr)
const;
352 const bool with_prefix,
353 const hit::Node * node);
386 template <
typename T>
390 return InputParameters::getParamHelper<T>(
name,
_pars);
393 template <
typename T>
400 template <
typename T>
406 return getParam<T>(new_name);
409 return getParam<T>(old_name);
412 return getParam<T>(new_name);
416 "' is being retrieved without being set.\nDid you misspell it?");
419 mooseError(
"Parameter '" + new_name +
"' may not be provided alongside former parameter '" +
423 template <
typename T1,
typename T2>
424 std::vector<std::pair<T1, T2>>
427 return _pars.
get<T1, T2>(param1, param2);
430 template <
typename T>
437 template <
typename... Args>
444 template <
typename... Args>
451 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.
void callMooseError(std::string msg, const bool with_prefix, const hit::Node *node=nullptr) const
External method for calling moose error with added object context.
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.
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
void mooseWarningNonPrefixed(Args &&... args) const
Emits a warning without the prefixing included in mooseWarning().
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.
void mooseDeprecatedStream(S &oss, const bool expired, const bool print_title, Args &&... args)
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.
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...