OGS
ParameterLib::FunctionParameter< T > Struct Template Referencefinal

Detailed Description

template<typename T>
struct ParameterLib::FunctionParameter< T >

A parameter class evaluating functions defined by user-provided mathematical expressions.

Currently, x, y, z, and t are supported as variables of the functions.

Uses per-thread storage for thread-safe evaluation.

Definition at line 24 of file FunctionParameter.h.

#include <FunctionParameter.h>

Inheritance diagram for ParameterLib::FunctionParameter< T >:
[legend]
Collaboration diagram for ParameterLib::FunctionParameter< T >:
[legend]

Public Member Functions

 FunctionParameter (std::string const &name, std::vector< std::string > const &vec_expression_str, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
bool isTimeDependent () const override
int getNumberOfGlobalComponents () const override
std::vector< T > operator() (double const t, SpatialPosition const &pos) const override
 Returns the parameter value at the given time and position.
Public Member Functions inherited from ParameterLib::Parameter< T >
 ~Parameter () override=default
virtual Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > getNodalValuesOnElement (MeshLib::Element const &element, double const t) const
 Returns a matrix of values for all nodes of the given element.
 ParameterBase (std::string name_, MeshLib::Mesh const *mesh=nullptr)
Public Member Functions inherited from ParameterLib::ParameterBase
 ParameterBase (std::string name_, MeshLib::Mesh const *mesh=nullptr)
virtual ~ParameterBase ()=default
void setCoordinateSystem (CoordinateSystem const &coordinate_system)
virtual void initialize (std::vector< std::unique_ptr< ParameterBase > > const &)
MeshLib::Mesh const * mesh () const

Public Attributes

FunctionEvaluation function_evaluation_
Public Attributes inherited from ParameterLib::ParameterBase
std::string const name

Additional Inherited Members

Protected Member Functions inherited from ParameterLib::ParameterBase
std::vector< double > rotateWithCoordinateSystem (std::vector< double > const &values, SpatialPosition const &pos) const
Protected Attributes inherited from ParameterLib::ParameterBase
std::optional< CoordinateSystem_coordinate_system
MeshLib::Mesh const * _mesh

Constructor & Destructor Documentation

◆ FunctionParameter()

template<typename T>
ParameterLib::FunctionParameter< T >::FunctionParameter ( std::string const & name,
std::vector< std::string > const & vec_expression_str,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves )
inline

Constructing from a vector of expressions

Parameters
namethe parameter's name
vec_expression_stra vector of mathematical expressions
curvesnamed list of curves used by expressions. The vector size specifies the number of components of the parameter.

Definition at line 34 of file FunctionParameter.h.

References function_evaluation_, and ParameterLib::ParameterBase::name.

Member Function Documentation

◆ getNumberOfGlobalComponents()

template<typename T>
int ParameterLib::FunctionParameter< T >::getNumberOfGlobalComponents ( ) const
inlineoverridevirtual

Returns the number of components this Parameter has at every position and point in time.

Implements ParameterLib::Parameter< T >.

Definition at line 51 of file FunctionParameter.h.

52 {
53 return function_evaluation_.getNumberOfComponents();
54 }

References function_evaluation_.

◆ isTimeDependent()

template<typename T>
bool ParameterLib::FunctionParameter< T >::isTimeDependent ( ) const
inlineoverridevirtual

Implements ParameterLib::ParameterBase.

Definition at line 46 of file FunctionParameter.h.

47 {
48 return function_evaluation_.isTimeDependent();
49 }

References function_evaluation_.

◆ operator()()

template<typename T>
std::vector< T > ParameterLib::FunctionParameter< T >::operator() ( double const t,
SpatialPosition const & pos ) const
inlineoverridevirtual

Returns the parameter value at the given time and position.

Implements ParameterLib::Parameter< T >.

Definition at line 56 of file FunctionParameter.h.

58 {
60 function_evaluation_.getNumberOfComponents()));
61 function_evaluation_.evaluate(pos, t, values);
62 if (!this->_coordinate_system)
63 {
64 return values;
65 }
67 }
std::vector< double > rotateWithCoordinateSystem(std::vector< double > const &values, SpatialPosition const &pos) const
std::optional< CoordinateSystem > _coordinate_system

References ParameterLib::ParameterBase::_coordinate_system, function_evaluation_, and ParameterLib::ParameterBase::rotateWithCoordinateSystem().

Member Data Documentation

◆ function_evaluation_

template<typename T>
FunctionEvaluation ParameterLib::FunctionParameter< T >::function_evaluation_

The documentation for this struct was generated from the following file: