Interface for objects that need to use UserObjects. More...
#include <UserObjectInterface.h>
Public Member Functions | |
UserObjectInterface (const MooseObject *moose_object) | |
UserObjectName | getUserObjectName (const std::string ¶m_name) const |
template<class T > | |
const T & | getUserObject (const std::string ¶m_name, bool is_dependency=true) const |
Get an user object with a given parameter param_name . More... | |
template<class T > | |
const T & | getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const |
Get an user object with the name object_name . More... | |
const UserObject & | getUserObjectBase (const std::string ¶m_name, bool is_dependency=true) const |
Get an user object with a given parameter param_name . More... | |
const UserObject & | getUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const |
Get an user object with the name object_name . More... | |
bool | hasUserObject (const std::string ¶m_name) const |
template<class T > | |
bool | hasUserObject (const std::string ¶m_name) const |
bool | hasUserObjectByName (const UserObjectName &object_name) const |
template<class T > | |
bool | hasUserObjectByName (const UserObjectName &object_name) const |
Static Public Member Functions | |
static InputParameters | validParams () |
Protected Member Functions | |
virtual void | addUserObjectDependencyHelper (const UserObject &) const |
Helper for deriving classes to override to add dependencies when a UserObject is requested. More... | |
Private Member Functions | |
const UserObject & | getUserObjectFromFEProblem (const UserObjectName &object_name) const |
Go directly to the FEProblem for the requested UserObject . More... | |
template<class T > | |
const T & | castUserObject (const UserObject &uo_base, const std::string ¶m_name="") const |
Internal helper that casts the UserObject uo_base to the requested type. More... | |
void | mooseObjectError (const std::string ¶m_name, std::stringstream &oss) const |
emit an error for the given parameter More... | |
const std::string & | userObjectType (const UserObject &uo) const |
Gets a UserObject's type; avoids including UserObject.h in the UserObjectInterface. More... | |
const std::string & | userObjectName (const UserObject &uo) const |
Gets a UserObject's name; avoids including UserObject.h in the UserObjectInterface. More... | |
Private Attributes | |
const MooseObject & | _uoi_moose_object |
Moose object using the interface. More... | |
const FEProblemBase & | _uoi_feproblem |
Reference to the FEProblemBase instance. More... | |
const THREAD_ID | _uoi_tid |
Thread ID. More... | |
Interface for objects that need to use UserObjects.
Definition at line 24 of file UserObjectInterface.h.
UserObjectInterface::UserObjectInterface | ( | const MooseObject * | moose_object | ) |
params | The parameters used by the object being instantiated. This class needs them so it can get the user object named in the input file, but the object calling getUserObject only needs to use the name on the left hand side of the statement "user_object = user_object_name" |
Definition at line 24 of file UserObjectInterface.C.
|
inlineprotectedvirtual |
Helper for deriving classes to override to add dependencies when a UserObject is requested.
Reimplemented in AuxKernelTempl< ComputeValueType >, AuxKernelTempl< RT >, AuxKernelTempl< RealVectorValue >, AuxKernelTempl< Real >, UserObject, and InitialConditionBase.
Definition at line 110 of file UserObjectInterface.h.
Referenced by getUserObjectBaseByName().
|
private |
Internal helper that casts the UserObject uo_base
to the requested type.
Exits with a useful error if the casting failed. If the parameter param_name
is provided and is valid, a paramError() will be used instead.
Definition at line 148 of file UserObjectInterface.h.
const T & UserObjectInterface::getUserObject | ( | const std::string & | param_name, |
bool | is_dependency = true |
||
) | const |
Get an user object with a given parameter param_name
.
param_name | The name of the parameter key of the user object to retrieve |
is_dependency | Whether the user object we are retrieving should be viewed as a dependency, e.g. whether the retrieved user object should be sorted and executed before this object (if we are a user object) |
param_name
Definition at line 169 of file UserObjectInterface.h.
const UserObject & UserObjectInterface::getUserObjectBase | ( | const std::string & | param_name, |
bool | is_dependency = true |
||
) | const |
Get an user object with a given parameter param_name
.
param_name | The name of the parameter key of the user object to retrieve |
is_dependency | Whether the user object we are retrieving should be viewed as a dependency, e.g. whether the retrieved user object should be sorted and executed before this object (if we are a user object) |
param_name
Definition at line 86 of file UserObjectInterface.C.
Referenced by getUserObject().
const UserObject & UserObjectInterface::getUserObjectBaseByName | ( | const UserObjectName & | object_name, |
bool | is_dependency = true |
||
) | const |
Get an user object with the name object_name
.
object_name | The name of the user object to retrieve |
is_dependency | Whether the user object we are retrieving should be viewed as a dependency, e.g. whether the retrieved user object should be sorted and executed before this object (if we are a user object) |
object_name
Definition at line 98 of file UserObjectInterface.C.
Referenced by UserObject::getDependObjects(), getUserObjectBase(), and getUserObjectByName().
const T & UserObjectInterface::getUserObjectByName | ( | const UserObjectName & | object_name, |
bool | is_dependency = true |
||
) | const |
Get an user object with the name object_name
.
object_name | The name of the user object to retrieve |
is_dependency | Whether the user object we are retrieving should be viewed as a dependency, e.g. whether the retrieved user object should be sorted and executed before this object (if we are a user object) |
object_name
Definition at line 176 of file UserObjectInterface.h.
|
private |
Go directly to the FEProblem for the requested UserObject
.
Definition at line 80 of file UserObjectInterface.C.
Referenced by hasUserObjectByName().
UserObjectName UserObjectInterface::getUserObjectName | ( | const std::string & | param_name | ) | const |
param_name
Definition at line 35 of file UserObjectInterface.C.
Referenced by getUserObjectBase(), and hasUserObject().
bool UserObjectInterface::hasUserObject | ( | const std::string & | param_name | ) | const |
param_name
. Definition at line 68 of file UserObjectInterface.C.
bool UserObjectInterface::hasUserObject | ( | const std::string & | param_name | ) | const |
Definition at line 184 of file UserObjectInterface.h.
bool UserObjectInterface::hasUserObjectByName | ( | const UserObjectName & | object_name | ) | const |
Definition at line 74 of file UserObjectInterface.C.
Referenced by getUserObjectBase(), getUserObjectBaseByName(), hasUserObject(), and hasUserObjectByName().
bool UserObjectInterface::hasUserObjectByName | ( | const UserObjectName & | object_name | ) | const |
Definition at line 191 of file UserObjectInterface.h.
|
private |
emit an error for the given parameter
Definition at line 126 of file UserObjectInterface.C.
Referenced by castUserObject().
|
private |
Gets a UserObject's name; avoids including UserObject.h in the UserObjectInterface.
Definition at line 120 of file UserObjectInterface.C.
Referenced by castUserObject().
|
private |
Gets a UserObject's type; avoids including UserObject.h in the UserObjectInterface.
Definition at line 114 of file UserObjectInterface.C.
Referenced by castUserObject().
|
static |
Definition at line 19 of file UserObjectInterface.C.
Referenced by FVInterfaceKernel::validParams().
|
private |
Reference to the FEProblemBase instance.
Definition at line 140 of file UserObjectInterface.h.
Referenced by getUserObjectBaseByName(), getUserObjectFromFEProblem(), and hasUserObjectByName().
|
private |
Moose object using the interface.
Definition at line 137 of file UserObjectInterface.h.
Referenced by getUserObjectBase(), getUserObjectBaseByName(), getUserObjectName(), and mooseObjectError().
|
private |
Thread ID.
Definition at line 143 of file UserObjectInterface.h.
Referenced by getUserObjectBaseByName().