OGS
|
A parameter class evaluating functions defined by user-provided mathematical expressions.
Currently, x, y, z, and t are supported as variables of the functions.
Definition at line 29 of file FunctionParameter.h.
#include <FunctionParameter.h>
Classes | |
class | CurveWrapper |
Public Types | |
using | symbol_table_t = exprtk::symbol_table<T> |
using | expression_t = exprtk::expression<T> |
using | parser_t = exprtk::parser<T> |
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 |
Private Attributes | |
symbol_table_t | _symbol_table |
std::vector< expression_t > | _vec_expression |
std::vector< std::pair< std::string, CurveWrapper > > | _curves |
std::mutex | _mutex |
Additional Inherited Members | |
Public Attributes inherited from ParameterLib::ParameterBase | |
std::string const | name |
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 |
using ParameterLib::FunctionParameter< T >::expression_t = exprtk::expression<T> |
Definition at line 50 of file FunctionParameter.h.
using ParameterLib::FunctionParameter< T >::parser_t = exprtk::parser<T> |
Definition at line 51 of file FunctionParameter.h.
using ParameterLib::FunctionParameter< T >::symbol_table_t = exprtk::symbol_table<T> |
Definition at line 49 of file FunctionParameter.h.
|
inline |
Constructing from a vector of expressions
name | the parameter's name |
vec_expression_str | a vector of mathematical expressions |
curves | named list of curves used by expressions. The vector size specifies the number of components of the parameter. |
Definition at line 61 of file FunctionParameter.h.
References ParameterLib::FunctionParameter< T >::_curves, ParameterLib::FunctionParameter< T >::_symbol_table, ParameterLib::FunctionParameter< T >::_vec_expression, and OGS_FATAL.
|
inlineoverridevirtual |
Returns the number of components this Parameter has at every position and point in time.
Implements ParameterLib::Parameter< T >.
Definition at line 105 of file FunctionParameter.h.
References ParameterLib::FunctionParameter< T >::_vec_expression.
Referenced by ParameterLib::FunctionParameter< T >::operator()().
|
inlineoverridevirtual |
Implements ParameterLib::ParameterBase.
Definition at line 103 of file FunctionParameter.h.
|
inlineoverridevirtual |
Returns the parameter value at the given time and position.
Implements ParameterLib::Parameter< T >.
Definition at line 110 of file FunctionParameter.h.
References ParameterLib::ParameterBase::_coordinate_system, ParameterLib::FunctionParameter< T >::_mutex, ParameterLib::FunctionParameter< T >::_symbol_table, ParameterLib::FunctionParameter< T >::_vec_expression, ParameterLib::SpatialPosition::getCoordinates(), ParameterLib::FunctionParameter< T >::getNumberOfGlobalComponents(), OGS_FATAL, and ParameterLib::ParameterBase::rotateWithCoordinateSystem().
|
private |
Definition at line 152 of file FunctionParameter.h.
Referenced by ParameterLib::FunctionParameter< T >::FunctionParameter().
|
mutableprivate |
Definition at line 153 of file FunctionParameter.h.
Referenced by ParameterLib::FunctionParameter< T >::operator()().
|
private |
Definition at line 150 of file FunctionParameter.h.
Referenced by ParameterLib::FunctionParameter< T >::FunctionParameter(), and ParameterLib::FunctionParameter< T >::operator()().
|
private |
Definition at line 151 of file FunctionParameter.h.
Referenced by ParameterLib::FunctionParameter< T >::FunctionParameter(), ParameterLib::FunctionParameter< T >::getNumberOfGlobalComponents(), and ParameterLib::FunctionParameter< T >::operator()().