![]() |
OGS
|
A function property defined by mathematical expression. For the evaluation of the expressions the exprtk library is used. In the expressions all variables defined in MaterialPropertyLib::Variable enum can be used.
Definition at line 26 of file Function.h.
#include <Function.h>
Public Member Functions | |
Function (std::string name, std::vector< std::string > const &value_string_expressions, std::vector< std::pair< std::string, std::vector< std::string >>> const &dvalue_string_expressions) | |
PropertyDataType | value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override |
PropertyDataType | dValue (VariableArray const &variable_array, Variable const primary_variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override |
![]() | |
virtual | ~Property () |
virtual PropertyDataType | initialValue (ParameterLib::SpatialPosition const &pos, double const t) const |
virtual PropertyDataType | value () const |
virtual PropertyDataType | value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
virtual PropertyDataType | dValue (VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
virtual PropertyDataType | d2Value (VariableArray const &variable_array, Variable const variable1, Variable const variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
Default implementation: 2nd derivative of any constant property is zero. More... | |
void | setScale (std::variant< Medium *, Phase *, Component * > scale) |
template<typename T > | |
T | initialValue (ParameterLib::SpatialPosition const &pos, double const t) const |
template<typename T > | |
T | value () const |
template<typename T > | |
T | value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
template<typename T > | |
T | value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
template<typename T > | |
T | dValue (VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
template<typename T > | |
T | dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
template<typename T > | |
T | d2Value (VariableArray const &variable_array, Variable const &variable1, Variable const &variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
Private Types | |
using | Expression = exprtk::expression< double > |
Private Attributes | |
std::vector< std::pair< int, double * > > | symbol_values_ |
Mapping from variable array index to symbol table values. More... | |
std::vector< Expression > | value_expressions_ |
std::vector< std::pair< Variable, std::vector< Expression > > > | dvalue_expressions_ |
Additional Inherited Members | |
![]() | |
std::string | name_ |
PropertyDataType | value_ |
The single value of a property. More... | |
PropertyDataType | dvalue_ |
std::variant< Medium *, Phase *, Component * > | scale_ |
|
private |
Definition at line 47 of file Function.h.
MaterialPropertyLib::Function::Function | ( | std::string | name, |
std::vector< std::string > const & | value_string_expressions, | ||
std::vector< std::pair< std::string, std::vector< std::string >>> const & | dvalue_string_expressions | ||
) |
Definition at line 151 of file Function.cpp.
References MaterialPropertyLib::collectVariables(), MaterialPropertyLib::compileExpressions(), MaterialPropertyLib::convertStringToVariable(), dvalue_expressions_, MaterialPropertyLib::name, MaterialPropertyLib::Property::name_, symbol_values_, and value_expressions_.
|
overridevirtual |
This virtual method will compute the property derivative value based on the variables that are passed as arguments with the default implementation using empty variables array for the previous time step.
The default implementation of this method only returns the property value derivative without altering it.
Reimplemented from MaterialPropertyLib::Property.
Definition at line 196 of file Function.cpp.
References dvalue_expressions_, MaterialPropertyLib::evaluateExpressions(), MaterialPropertyLib::Property::name_, OGS_FATAL, symbol_values_, and MaterialPropertyLib::variable_enum_to_string.
|
overridevirtual |
This virtual method will compute the property value based on the variables that are passed as arguments with the default implementation using empty variables array for the previous time step.
Reimplemented from MaterialPropertyLib::Property.
Definition at line 188 of file Function.cpp.
References MaterialPropertyLib::evaluateExpressions(), symbol_values_, and value_expressions_.
|
private |
Derivative expressions with respect to the variable. Multiple expressions are representing vector-valued functions.
Definition at line 57 of file Function.h.
Referenced by Function(), and dValue().
|
private |
Mapping from variable array index to symbol table values.
Definition at line 50 of file Function.h.
Referenced by Function(), dValue(), and value().
|
private |
Value expressions. Multiple expressions are representing vector-valued functions.
Definition at line 53 of file Function.h.
Referenced by Function(), and value().