25 : _uoi_moose_object(*moose_object),
26 _uoi_feproblem(*_uoi_moose_object.parameters().getCheckedPointerParam<
FEProblemBase *>(
28 _uoi_tid(_uoi_moose_object.parameters().have_parameter<
THREAD_ID>(
"_tid")
29 ? _uoi_moose_object.parameters().get<
THREAD_ID>(
"_tid")
34#ifdef MOOSE_KOKKOS_ENABLED
37 : _uoi_moose_object(object._uoi_moose_object),
38 _uoi_feproblem(object._uoi_feproblem),
39 _uoi_tid(object._uoi_tid)
49 if (!params.isParamValid(param_name))
52 "\" when getting a UserObjectName.",
53 "\n\nKnown parameters:\n",
59 if (params.isType<UserObjectName>(param_name))
60 name = params.get<UserObjectName>(param_name);
61 else if (params.isType<PostprocessorName>(param_name))
62 name = params.get<PostprocessorName>(param_name);
63 else if (params.isType<VectorPostprocessorName>(param_name))
64 name = params.get<VectorPostprocessorName>(param_name);
65 else if (params.isType<std::string>(param_name))
66 name = params.get<std::string>(param_name);
70 "Parameter of type \"",
71 params.type(param_name),
72 "\" is not an expected type for getting the name of a UserObject.");
88#ifdef MOOSE_KOKKOS_ENABLED
104#ifdef MOOSE_KOKKOS_ENABLED
109 mooseAssert(uo,
"getUserObjectFromFEProblem() could not find user object");
116 const bool is_dependency)
const
121 param_name,
"The requested UserObject with the name \"", object_name,
"\" was not found.");
128 const bool is_dependency)
const
132 "The requested UserObject with the name \"", object_name,
"\" was not found.");
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
bool hasKokkosUserObject(const std::string &name) const
Check if there if a Kokkos user object of given name.
const T & getKokkosUserObject(const std::string &name) const
Get the Kokkos user object by its name.
bool hasUserObject(const std::string &name) const
Check if there if a user object of given name.
const UserObject & getUserObjectBase(const std::string &name, const THREAD_ID tid=0) const
Get the user object by its name.
const InputParameters & parameters() const
Get the parameters of the object.
const std::string & type() const
Get the type of this class.
const std::string & name() const
Get the name of the class.
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 ...
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...
Every object that can be built by the factory should be derived from this class.
Interface for objects that need to use UserObjects.
virtual void addUserObjectDependencyHelper(const UserObjectBase &) const
Helper for deriving classes to override to add dependencies when a UserObject is requested.
UserObjectInterface(const MooseObject *moose_object)
const std::string & userObjectName(const UserObjectBase &uo) const
Gets a UserObject's name; avoids including UserObject.h in the UserObjectInterface.
UserObjectName getUserObjectName(const std::string ¶m_name) const
const UserObjectBase & getUserObjectFromFEProblem(const UserObjectName &object_name, const THREAD_ID tid=0) const
Go directly to the FEProblem for the requested object_name for thread ID tid.
static InputParameters validParams()
bool hasUserObject(const std::string ¶m_name) const
const FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
const UserObjectBase & getUserObjectBase(const std::string ¶m_name, bool is_dependency=true) const
Get an user object with a given parameter param_name.
const THREAD_ID _uoi_tid
Thread ID.
const std::string & userObjectType(const UserObjectBase &uo) const
Gets a UserObject's type; avoids including UserObject.h in the UserObjectInterface.
bool hasUserObjectByName(const UserObjectName &object_name) const
const UserObjectBase & getUserObjectBaseByName(const UserObjectName &object_name, bool is_dependency=true) const
Get an user object with the name object_name.
void mooseObjectError(const std::string ¶m_name, std::stringstream &oss) const
emit an error for the given parameter
const MooseObject & _uoi_moose_object
Moose object using the interface.