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 | |
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 reqested type. 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 22 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 23 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 108 of file UserObjectInterface.h.
Referenced by getUserObjectBaseByName().
|
private |
Internal helper that casts the UserObject uo_base
to the reqested 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 136 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 160 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 79 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 91 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 167 of file UserObjectInterface.h.
UserObjectName UserObjectInterface::getUserObjectName | ( | const std::string & | param_name | ) | const |
param_name
Definition at line 34 of file UserObjectInterface.C.
Referenced by getUserObjectBase(), and hasUserObject().
bool UserObjectInterface::hasUserObject | ( | const std::string & | param_name | ) | const |
param_name
. Definition at line 67 of file UserObjectInterface.C.
bool UserObjectInterface::hasUserObject | ( | const std::string & | param_name | ) | const |
Definition at line 175 of file UserObjectInterface.h.
bool UserObjectInterface::hasUserObjectByName | ( | const UserObjectName & | object_name | ) | const |
Definition at line 73 of file UserObjectInterface.C.
Referenced by getUserObjectBase(), getUserObjectBaseByName(), hasUserObject(), and hasUserObjectByName().
bool UserObjectInterface::hasUserObjectByName | ( | const UserObjectName & | object_name | ) | const |
Definition at line 182 of file UserObjectInterface.h.
|
private |
Gets a UserObject's name; avoids including UserObject.h in the UserObjectInterface.
Definition at line 113 of file UserObjectInterface.C.
Referenced by castUserObject().
|
private |
Gets a UserObject's type; avoids including UserObject.h in the UserObjectInterface.
Definition at line 107 of file UserObjectInterface.C.
Referenced by castUserObject().
|
static |
Definition at line 18 of file UserObjectInterface.C.
Referenced by FVInterfaceKernel::validParams().
|
private |
Reference to the FEProblemBase instance.
Definition at line 128 of file UserObjectInterface.h.
Referenced by getUserObjectBaseByName(), and hasUserObjectByName().
|
private |
Moose object using the interface.
Definition at line 125 of file UserObjectInterface.h.
Referenced by castUserObject(), getUserObjectBase(), getUserObjectBaseByName(), and getUserObjectName().
|
private |
Thread ID.
Definition at line 131 of file UserObjectInterface.h.
Referenced by getUserObjectBaseByName().