OGS
Function.h
Go to the documentation of this file.
1
9#pragma once
10
11#include <exprtk.hpp>
12#include <utility>
13#include <vector>
14
17
18namespace MaterialPropertyLib
19{
26class Function final : public Property
27{
28public:
30 std::string name,
31 std::vector<std::string> const& value_string_expressions,
32 std::vector<std::pair<std::string, std::vector<std::string>>> const&
33 dvalue_string_expressions);
34
35 PropertyDataType value(VariableArray const& variable_array,
37 double const t,
38 double const dt) const override;
39
40 PropertyDataType dValue(VariableArray const& variable_array,
41 Variable const variable,
43 double const t,
44 double const dt) const override;
45
46private:
47 using Expression = exprtk::expression<double>;
48
50 std::vector<std::pair<Variable, double*>> symbol_values_;
53 std::vector<Expression> value_expressions_;
56 std::vector<std::pair<Variable, std::vector<Expression>>>
58
59 mutable std::mutex mutex_;
60};
61} // namespace MaterialPropertyLib
std::vector< Expression > value_expressions_
Definition Function.h:53
std::vector< std::pair< Variable, double * > > symbol_values_
Mapping from variable array index to symbol table values.
Definition Function.h:50
std::vector< std::pair< Variable, std::vector< Expression > > > dvalue_expressions_
Definition Function.h:57
exprtk::expression< double > Expression
Definition Function.h:47
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 Function.cpp:153
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
Definition Function.cpp:197
virtual PropertyDataType value() const
Definition Property.cpp:76
std::variant< double, Eigen::Matrix< double, 2, 1 >, Eigen::Matrix< double, 3, 1 >, Eigen::Matrix< double, 2, 2 >, Eigen::Matrix< double, 3, 3 >, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 >, Eigen::MatrixXd > PropertyDataType
Definition Property.h:31