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 25 of file Function.h.
#include <Function.h>
Classes | |
class | Implementation |
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 variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override |
~Function () | |
Public Member Functions inherited from MaterialPropertyLib::Property | |
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. | |
virtual void | setProperties (std::vector< std::unique_ptr< Phase > > const &phases) |
Default implementation: | |
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 Member Functions | |
std::variant< Function::Implementation< 2 > *, Function::Implementation< 3 > * > | getImplementationForDimensionOfVariableArray (VariableArray const &variable_array) const |
Private Attributes | |
std::unique_ptr< Implementation< 2 > > | impl2_ |
std::unique_ptr< Implementation< 3 > > | impl3_ |
std::vector< Variable > | variables_ |
Variables used in the exprtk expressions. | |
std::mutex | mutex_ |
Additional Inherited Members | |
Protected Attributes inherited from MaterialPropertyLib::Property | |
std::string | name_ |
PropertyDataType | value_ |
The single value of a property. | |
PropertyDataType | dvalue_ |
std::variant< Medium *, Phase *, Component * > | scale_ |
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 323 of file Function.cpp.
References MaterialPropertyLib::collectVariables(), MaterialPropertyLib::convertStringToVariable(), impl2_, impl3_, MaterialPropertyLib::name, MaterialPropertyLib::Property::name_, and variables_.
|
default |
|
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 377 of file Function.cpp.
References MaterialPropertyLib::evaluateExpressions(), getImplementationForDimensionOfVariableArray(), mutex_, MaterialPropertyLib::Property::name_, OGS_FATAL, MaterialPropertyLib::variable_enum_to_string, and variables_.
|
private |
Definition at line 346 of file Function.cpp.
References impl2_, impl3_, MaterialPropertyLib::VariableArray::is2D(), MaterialPropertyLib::VariableArray::is3D(), and OGS_FATAL.
|
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 363 of file Function.cpp.
References MaterialPropertyLib::evaluateExpressions(), getImplementationForDimensionOfVariableArray(), mutex_, and variables_.
|
private |
Definition at line 51 of file Function.h.
Referenced by Function(), and getImplementationForDimensionOfVariableArray().
|
private |
Definition at line 52 of file Function.h.
Referenced by Function(), and getImplementationForDimensionOfVariableArray().
|
mutableprivate |
Definition at line 61 of file Function.h.
|
private |
Variables used in the exprtk expressions.
Definition at line 59 of file Function.h.
Referenced by Function(), dValue(), and value().