www.mooseframework.org
FunctionInterface.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 #include "FunctionInterface.h"
11 #include "Function.h"
12 #include "SubProblem.h"
13 #include "MooseTypes.h"
14 
15 template <>
18 {
19  return emptyInputParameters();
20 }
21 
23  : _fni_params(moose_object->parameters()),
24  _fni_feproblem(*_fni_params.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
25  _fni_tid(_fni_params.have_parameter<THREAD_ID>("_tid") ? _fni_params.get<THREAD_ID>("_tid") : 0)
26 {
27 }
28 
29 Function &
30 FunctionInterface::getFunction(const std::string & name)
31 {
32  return _fni_feproblem.getFunction(_fni_params.get<FunctionName>(name), _fni_tid);
33 }
34 
35 Function &
36 FunctionInterface::getFunctionByName(const FunctionName & name)
37 {
38  return _fni_feproblem.getFunction(name, _fni_tid);
39 }
Base class for function objects.
Definition: Function.h:40
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:42
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:161