www.mooseframework.org
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
FunctionInterface Class Reference

Interface for objects that need to use functions. More...

#include <FunctionInterface.h>

Inheritance diagram for FunctionInterface:
[legend]

Public Member Functions

 FunctionInterface (const MooseObject *moose_object)
 
const FunctiongetFunction (const std::string &name) const
 Get a function with a given name. More...
 
const FunctiongetFunctionByName (const FunctionName &name) const
 Get a function with a given name. More...
 
bool hasFunction (const std::string &param_name) const
 Determine if the function exists. More...
 
bool hasFunctionByName (const FunctionName &name) const
 Determine if the function exists. More...
 

Static Public Member Functions

static InputParameters validParams ()
 

Private Attributes

const InputParameters_fni_params
 Parameters of the object with this interface. More...
 
FEProblemBase_fni_feproblem
 Reference to FEProblemBase instance. More...
 
const THREAD_ID _fni_tid
 Thread ID. More...
 

Detailed Description

Interface for objects that need to use functions.

Inherit from this class at a very low level to make the getFunction method available.

Definition at line 35 of file FunctionInterface.h.

Constructor & Destructor Documentation

◆ FunctionInterface()

FunctionInterface::FunctionInterface ( const MooseObject moose_object)
Parameters
paramsThe parameters used by the object being instantiated. This class needs them so it can get the function named in the input file, but the object calling getFunction only needs to use the name on the left hand side of the statement "function = func_name"

Definition at line 22 of file FunctionInterface.C.

23  : _fni_params(moose_object->parameters()),
26 {
27 }
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.
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const THREAD_ID _fni_tid
Thread ID.
FEProblemBase & _fni_feproblem
Reference to FEProblemBase instance.
const InputParameters & _fni_params
Parameters of the object with this interface.
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
const InputParameters & parameters() const
Get the parameters of the object.
unsigned int THREAD_ID
Definition: MooseTypes.h:198

Member Function Documentation

◆ getFunction()

const Function & FunctionInterface::getFunction ( const std::string &  name) const

Get a function with a given name.

Parameters
nameThe name of the parameter key of the function to retrieve
Returns
The function with name associated with the parameter 'name'

Definition at line 30 of file FunctionInterface.C.

Referenced by FunctionDT::FunctionDT(), and Output::Output().

31 {
32  return _fni_feproblem.getFunction(_fni_params.get<FunctionName>(name), _fni_tid);
33 }
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.
virtual Function & getFunction(const std::string &name, const THREAD_ID tid=0)
const THREAD_ID _fni_tid
Thread ID.
FEProblemBase & _fni_feproblem
Reference to FEProblemBase instance.
const InputParameters & _fni_params
Parameters of the object with this interface.

◆ getFunctionByName()

const Function & FunctionInterface::getFunctionByName ( const FunctionName &  name) const

◆ hasFunction()

bool FunctionInterface::hasFunction ( const std::string &  param_name) const

Determine if the function exists.

Parameters
param_nameThe name of the function parameter
indexThe index of the function
Returns
True if the function exists

Definition at line 42 of file FunctionInterface.C.

43 {
44  return hasFunctionByName(_fni_params.get<FunctionName>(param_name));
45 }
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.
bool hasFunctionByName(const FunctionName &name) const
Determine if the function exists.
const InputParameters & _fni_params
Parameters of the object with this interface.

◆ hasFunctionByName()

bool FunctionInterface::hasFunctionByName ( const FunctionName &  name) const

Determine if the function exists.

Parameters
nameThe name of the function
Returns
True if the function exists

Definition at line 48 of file FunctionInterface.C.

Referenced by hasFunction().

49 {
50  return _fni_feproblem.hasFunction(name, _fni_tid);
51 }
const THREAD_ID _fni_tid
Thread ID.
FEProblemBase & _fni_feproblem
Reference to FEProblemBase instance.
virtual bool hasFunction(const std::string &name, const THREAD_ID tid=0)

◆ validParams()

InputParameters FunctionInterface::validParams ( )
static

Definition at line 17 of file FunctionInterface.C.

Referenced by Control::validParams(), and FVInterfaceKernel::validParams().

18 {
19  return emptyInputParameters();
20 }
InputParameters emptyInputParameters()

Member Data Documentation

◆ _fni_feproblem

FEProblemBase& FunctionInterface::_fni_feproblem
private

Reference to FEProblemBase instance.

Definition at line 84 of file FunctionInterface.h.

Referenced by getFunction(), getFunctionByName(), and hasFunctionByName().

◆ _fni_params

const InputParameters& FunctionInterface::_fni_params
private

Parameters of the object with this interface.

Definition at line 81 of file FunctionInterface.h.

Referenced by getFunction(), and hasFunction().

◆ _fni_tid

const THREAD_ID FunctionInterface::_fni_tid
private

Thread ID.

Definition at line 87 of file FunctionInterface.h.

Referenced by getFunction(), getFunctionByName(), and hasFunctionByName().


The documentation for this class was generated from the following files: