www.mooseframework.org
UserObjectInterface.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // MOOSE includes
11 #include "UserObjectInterface.h"
14 #include "InputParameters.h"
15 
17  : _uoi_params(moose_object->parameters()),
18  _uoi_feproblem(*_uoi_params.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
19  _uoi_tid(_uoi_params.have_parameter<THREAD_ID>("_tid") ? _uoi_params.get<THREAD_ID>("_tid") : 0)
20 {
21 }
22 
23 const UserObject &
24 UserObjectInterface::getUserObjectBase(const std::string & name)
25 {
26  return _uoi_feproblem.getUserObjectBase(_uoi_params.get<UserObjectName>(name));
27 }
28 
29 const UserObject &
31 {
32  return _uoi_feproblem.getUserObjectBase(name);
33 }
34 
35 bool
37 {
38  return (dynamic_cast<const DiscreteElementUserObject *>(&uo) != NULL) ||
39  (dynamic_cast<const ThreadedGeneralUserObject *>(&uo) != NULL);
40 }
const UserObject & getUserObjectBase(const std::string &name) const
Get the user object by its name.
const InputParameters & _uoi_params
Parameters of the object with this interface.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
const UserObject & getUserObjectBaseByName(const std::string &name)
Get an user object with a given name.
FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
const UserObject & getUserObjectBase(const std::string &name)
Get an user object with a given parameter name.
bool needThreadedCopy(const UserObject &uo) const
Check if the threaded copy of the user object is needed.
Base class for user-specific data.
Definition: UserObject.h:37
unsigned int THREAD_ID
Definition: MooseTypes.h:161
An instance of this object type has one copy per thread that runs on each thread. ...
UserObjectInterface(const MooseObject *moose_object)