https://mooseframework.inl.gov
FunctionInterface.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 #include "FEProblemBase.h"
15 
18 {
19  return emptyInputParameters();
20 }
21 
23  :
24 #ifdef MOOSE_KOKKOS_ENABLED
25  _fni_object(*moose_object),
26 #endif
27  _fni_params(moose_object->parameters()),
28  _fni_feproblem(*_fni_params.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
29  _fni_tid(_fni_params.have_parameter<THREAD_ID>("_tid") ? _fni_params.get<THREAD_ID>("_tid") : 0)
30 {
31 }
32 
33 const Function &
34 FunctionInterface::getFunction(const std::string & name) const
35 {
36  return getFunctionByName(_fni_params.get<FunctionName>(name));
37 }
38 
39 const Function &
40 FunctionInterface::getFunctionByName(const FunctionName & name) const
41 {
43 }
44 
45 bool
46 FunctionInterface::hasFunction(const std::string & param_name) const
47 {
48  return hasFunctionByName(_fni_params.get<FunctionName>(param_name));
49 }
50 
51 bool
52 FunctionInterface::hasFunctionByName(const FunctionName & name) const
53 {
55 }
std::string name(const ElemQuality q)
Base class for function objects.
Definition: Function.h:29
FunctionInterface(const MooseObject *moose_object)
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
const Function & getFunction(const std::string &name) const
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, const THREAD_ID tid=0)
const THREAD_ID _fni_tid
Thread ID.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
bool hasFunctionByName(const FunctionName &name) const
Determine if the function exists.
FEProblemBase & _fni_feproblem
Reference to FEProblemBase instance.
bool hasFunction(const std::string &param_name) const
Determine if the function exists.
const InputParameters & _fni_params
Parameters of the object with this interface.
static InputParameters validParams()
const Function & getFunctionByName(const FunctionName &name) const
Get a function with a given name.
virtual bool hasFunction(const std::string &name, const THREAD_ID tid=0)
const Elem & get(const ElemType type_in)
unsigned int THREAD_ID
Definition: MooseTypes.h:237