www.mooseframework.org
FunctionInterface.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "FunctionInterface.h"
16 #include "Function.h"
17 #include "SubProblem.h"
18 #include "MooseTypes.h"
19 
20 template <>
23 {
24  return emptyInputParameters();
25 }
26 
28  : _fni_params(moose_object->parameters()),
29  _fni_feproblem(*_fni_params.get<FEProblemBase *>("_fe_problem_base")),
30  _fni_tid(_fni_params.have_parameter<THREAD_ID>("_tid") ? _fni_params.get<THREAD_ID>("_tid") : 0)
31 {
32 }
33 
34 Function &
35 FunctionInterface::getFunction(const std::string & name)
36 {
37  return _fni_feproblem.getFunction(_fni_params.get<FunctionName>(name), _fni_tid);
38 }
39 
40 Function &
41 FunctionInterface::getFunctionByName(const FunctionName & name)
42 {
43  return _fni_feproblem.getFunction(name, _fni_tid);
44 }
Base class for function objects.
Definition: Function.h:46
InputParameters validParams< FunctionInterface >()
FunctionInterface(const MooseObject *moose_object)
Function & getFunction(const std::string &name)
Get a function with a given name.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
InputParameters emptyInputParameters()
virtual Function & getFunction(const std::string &name, THREAD_ID tid=0)
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
FEProblemBase & _fni_feproblem
Reference to FEProblemBase instance.
const InputParameters & _fni_params
Parameters of the object with this interface.
Function & getFunctionByName(const FunctionName &name)
Get a function with a given name.
THREAD_ID _fni_tid
Thread ID.
unsigned int THREAD_ID
Definition: MooseTypes.h:79